public static List<File> walk(String path){
  LinkedList<File> output=new LinkedList<File>();
  File root=new File(path);
  File[] list=root.listFiles();
  if (list == null) {
    return output;
  }
  for (  File f : list) {
    if (f.isDirectory()) {
      output.addAll(walk(f.getAbsolutePath()));
    }
 else {
      output.addLast(f);
    }
  }
  return output;
}

public static List < File > walk ( String path ) { LinkedList < File > output = new LinkedList < File > ( ) ; File root = new File ( path ) ; File [ ] list = root . listFiles ( ) ; if ( list == null ) { return output ; } for ( File f : list ) { if ( f . isDirectory ( ) ) { output . addAll ( walk ( f . getAbsolutePath ( ) ) ) ; } else { output . addLast ( f ) ; } } return output ; }
recursively walk through the path and return all found files ( not directory )
