List < String > listCompiledClasses ( final File classFolder ) { List < String > classNames = new ArrayList < String > ( ) ; if ( ! classFolder . exists ( ) ) { getLog ( ) . info ( "Class folder does not exist; skipping scan" ) ; return classNames ; } final String extension = ".class" ; final DirectoryScanner directoryScanner = new DirectoryScanner ( ) ; directoryScanner . setBasedir ( classFolder ) ; directoryScanner . setIncludes ( new String [ ] { "**" + File . separator + "*" + extension } ) ; directoryScanner . scan ( ) ; String [ ] files = directoryScanner . getIncludedFiles ( ) ; String className ; for ( String file : files ) { className = file . substring ( 0 , file . length ( ) - extension . length ( ) ) . replace ( File . separator , "." ) ; classNames . add ( className ) ; } return classNames ; }
Walks the classFolder and finds all classes