private List < File > listFiles ( File file , List < File > files ) { File [ ] children = file . listFiles ( ) ; if ( children != null ) { for ( File child : children ) { files . add ( child ) ; listFiles ( child , files ) ; } } return files ; }
Recurse over entire directory subtree adding entries to the file list .