private void handleDirectory ( final Predicate < String > filter , final File rootDir , final List < String > discoveredFiles ) { try { new DirectoryWalker < String > ( ) { private Path startDir ; public void walk ( ) throws IOException { this . startDir = rootDir . toPath ( ) ; this . walk ( rootDir , discoveredFiles ) ; } @ Override protected void handleFile ( File file , int depth , Collection < String > discoveredFiles ) throws IOException { String newPath = startDir . relativize ( file . toPath ( ) ) . toString ( ) ; if ( filter . accept ( newPath ) ) discoveredFiles . add ( newPath ) ; } } . walk ( ) ; } catch ( IOException ex ) { LOG . log ( Level . SEVERE , "Error reading Furnace addon directory" , ex ) ; } }
Scans given directory for files passing given filter adds the results into given list .