code: private void findFiles(File directory) throws IOException, ClassNotFoundException {
  
          File[] files = directory.listFiles(new FilenameFilter() {
              public boolean accept(File dir, String name) {
                  return name.endsWith(".class");
              }
          });
  
          if (files != null) {
              for (File file : files) {
                  int current = currentDirectoryPath.length();
                  String fileName = file.getCanonicalPath().substring(++current);
                  String className = fileName.replace(File.separatorChar, '.').substring(0, fileName.length() - 6);
                  tryClass(className);
              }
          }
      }
docs: This will scan directory for class files, non-recursive.
  
  @param directory directory to scan.
  @throws IOException, NotFoundException