public void scan ( final String [ ] packages ) { LOGGER . info ( "Scanning packages {}:" , ArrayUtils . toString ( packages ) ) ; for ( final String pkg : packages ) { try { final String pkgFile = pkg . replace ( ' ' , ' ' ) ; final Enumeration < URL > urls = getRootClassloader ( ) . getResources ( pkgFile ) ; while ( urls . hasMoreElements ( ) ) { final URL url = urls . nextElement ( ) ; try { final URI uri = getURI ( url ) ; LOGGER . debug ( "Scanning {}" , uri ) ; scan ( uri , pkgFile ) ; } catch ( final URISyntaxException e ) { LOGGER . debug ( "URL {} cannot be converted to a URI" , url , e ) ; } } } catch ( final IOException ex ) { throw new RuntimeException ( "The resources for the package" + pkg + ", could not be obtained" , ex ) ; } } LOGGER . info ( "Found {} matching classes and {} matching files" , matchingClasses . size ( ) , matchingFiles . size ( ) ) ; }
Scans packages for matching Java classes .