public static List<File> findFilesInDir(File directory,FilenameFilter filter){
  Vector<File> files=new Vector<File>();
  File[] entries=directory.listFiles();
  for (  File entry : entries) {
    if (filter == null || filter.accept(directory,entry.getName())) {
      files.add(entry);
    }
    if (entry.isDirectory()) {
      files.addAll(findFilesInDir(entry,filter));
    }
  }
  return files;
}

public static List < File > findFilesInDir ( File directory , FilenameFilter filter ) { Vector < File > files = new Vector < File > ( ) ; File [ ] entries = directory . listFiles ( ) ; for ( File entry : entries ) { if ( filter == null || filter . accept ( directory , entry . getName ( ) ) ) { files . add ( entry ) ; } if ( entry . isDirectory ( ) ) { files . addAll ( findFilesInDir ( entry , filter ) ) ; } } return files ; }
given a java . io . file representing a directory , list all the files underneath that directory matching the given filenamefilter .
