public void readAll ( File dir , FileFilter ff , Closure closure , LogFilter logf , Stats stat ) throws IOException { File [ ] files = dir . listFiles ( ) ; if ( files == null ) { System . out . printf ( "Dir has no files= %s%n" , dir ) ; return ; } List < File > list = Arrays . asList ( files ) ; Collections . sort ( list ) ; for ( File f : list ) { if ( ( ff != null ) && ! ff . accept ( f ) ) continue ; if ( f . isDirectory ( ) ) readAll ( f , ff , closure , logf , stat ) ; else scanLogFile ( f , closure , logf , stat ) ; } }
Read all the files in a directory and process them . Files are sorted by filename .