public static List<VisorLogFile> fileTree(File file,int maxDepth,@Nullable FileFilter filter){
  if (file.isDirectory()) {
    File[] files=(filter == null) ? file.listFiles() : file.listFiles(filter);
    if (files == null)     return Collections.emptyList();
    List<VisorLogFile> res=new ArrayList<>(files.length);
    for (    File f : files) {
      if (f.isFile() && f.length() > 0)       res.add(new VisorLogFile(f));
 else       if (maxDepth > 1)       res.addAll(fileTree(f,maxDepth - 1,filter));
    }
    return res;
  }
  return F.asList(new VisorLogFile(file));
}

public static List < VisorLogFile > fileTree ( File file , int maxDepth , @ Nullable FileFilter filter ) { if ( file . isDirectory ( ) ) { File [ ] files = ( filter == null ) ? file . listFiles ( ) : file . listFiles ( filter ) ; if ( files == null ) return Collections . emptyList ( ) ; List < VisorLogFile > res = new ArrayList < > ( files . length ) ; for ( File f : files ) { if ( f . isFile ( ) && f . length ( ) > 0 ) res . add ( new VisorLogFile ( f ) ) ; else if ( maxDepth > 1 ) res . addAll ( fileTree ( f , maxDepth - 1 , filter ) ) ; } return res ; } return F . asList ( new VisorLogFile ( file ) ) ; }
finds all files in folder and in it ' s sub - tree of specified depth .
