private static void innerListFiles(Collection<File> files,File directory,IOFileFilter filter,boolean includeSubDirectories){
  File[] found=directory.listFiles((FileFilter)filter);
  if (found != null) {
    for (    File file : found) {
      if (file.isDirectory()) {
        if (includeSubDirectories) {
          files.add(file);
        }
        innerListFiles(files,file,filter,includeSubDirectories);
      }
 else {
        files.add(file);
      }
    }
  }
}

private static void innerListFiles ( Collection < File > files , File directory , IOFileFilter filter , boolean includeSubDirectories ) { File [ ] found = directory . listFiles ( ( FileFilter ) filter ) ; if ( found != null ) { for ( File file : found ) { if ( file . isDirectory ( ) ) { if ( includeSubDirectories ) { files . add ( file ) ; } innerListFiles ( files , file , filter , includeSubDirectories ) ; } else { files . add ( file ) ; } } } }
finds files within a given directory ( and optionally its subdirectories ) . all files found are filtered by an iofilefilter .
