private Class findClassInComponents ( String name ) throws ClassNotFoundException { // we need to search the components of the path to see if // we can find the class we want. String classFilename = getClassFilename ( name ) ; Enumeration e = pathComponents . elements ( ) ; while ( e . hasMoreElements ( ) ) { File pathComponent = ( File ) e . nextElement ( ) ; try ( final InputStream stream = getResourceStream ( pathComponent , classFilename ) ) { if ( stream != null ) { log ( "Loaded from " + pathComponent + " " + classFilename , Project . MSG_DEBUG ) ; return getClassFromStream ( stream , name , pathComponent ) ; } } catch ( SecurityException se ) { throw se ; } catch ( IOException ioe ) { // ioe.printStackTrace(); log ( "Exception reading component " + pathComponent + " (reason: " + ioe . getMessage ( ) + ")" , Project . MSG_VERBOSE ) ; } } throw new ClassNotFoundException ( name ) ; }
Finds a class on the given classpath .