示例#1
0
 private static void visit(File file, FileVisitor fileVisitor) {
   if (file.isDirectory()) {
     File[] files = file.listFiles();
     for (int i = 0; i < files.length; i++) {
       File f = files[i];
       visit(f, fileVisitor);
     }
   } else { // regular file
     fileVisitor.visit(file);
   }
 }
示例#2
0
 /**
  * @param baseDir
  * @param fileVisitor
  */
 public static void visitRecursively(File baseDir, FileVisitor fileVisitor) {
   visit(baseDir, fileVisitor);
 }