private void populateFileList ( ResourceFileList list , File root , boolean recurse ) throws IOException { if ( root . isDirectory ( ) ) { File [ ] files = root . listFiles ( ) ; if ( files != null ) { for ( File file : files ) { if ( file . isFile ( ) && filter . accept ( root , file . getName ( ) ) ) { ResourceFileLocation location = new ResourceFileLocation ( file . getName ( ) , file . getAbsolutePath ( ) ) ; list . add ( location ) ; } else if ( recurse && file . isDirectory ( ) ) { populateFileList ( list , file , recurse ) ; } } } } else { LOGGER . warning ( root . getAbsolutePath ( ) + " is not a directory." ) ; return ; } }
add all files matching this . filter beneath root to list recursing if recurse is set .