private void findClassesInDirectory(File classDir,String packagePrefix,String pathPrefix,Set<String> classNames,Set<String> subpackageNames) throws IOException {
  File directory=new File(classDir,pathPrefix);
  if (directory.exists()) {
    for (    File f : directory.listFiles()) {
      String name=f.getName();
      if (name.endsWith(CLASS_EXTENSION) && isToplevelClass(name)) {
        classNames.add(packagePrefix + getClassName(name));
      }
 else       if (f.isDirectory()) {
        subpackageNames.add(packagePrefix + name);
      }
    }
  }
}

private void findClassesInDirectory ( File classDir , String packagePrefix , String pathPrefix , Set < String > classNames , Set < String > subpackageNames ) throws IOException { File directory = new File ( classDir , pathPrefix ) ; if ( directory . exists ( ) ) { for ( File f : directory . listFiles ( ) ) { String name = f . getName ( ) ; if ( name . endsWith ( CLASS_EXTENSION ) && isToplevelClass ( name ) ) { classNames . add ( packagePrefix + getClassName ( name ) ) ; } else if ( f . isDirectory ( ) ) { subpackageNames . add ( packagePrefix + name ) ; } } } }
finds all classes and sub packages that are below the packagename and add them to the respective sets . searches the package in a class directory .
