public URLLister createURLLister ( String protocol ) throws MalformedURLException { try { String className = ( String ) classes . get ( protocol ) ; if ( className == null ) { throw new MalformedURLException ( "No lister class defined for protocol " + protocol ) ; } Class < ? > clazz = Thread . currentThread ( ) . getContextClassLoader ( ) . loadClass ( className ) ; return ( URLLister ) clazz . newInstance ( ) ; } catch ( ClassNotFoundException e ) { throw new MalformedURLException ( e . getMessage ( ) ) ; } catch ( InstantiationException e ) { throw new MalformedURLException ( e . getMessage ( ) ) ; } catch ( IllegalAccessException e ) { throw new MalformedURLException ( e . getMessage ( ) ) ; } }
Create a URL lister for the supplied protocol