File Dir

 public static void main(String[] args) {
  ListFilesInDirectory("E:\\BeyondCompare_Study\\BeyondCompare_Study");
  
 }
 
 static void ListFilesInDirectory(String path ) {
   File file = new File(path);
   File[] files = file.listFiles();
   for (File fl : files) {
       if (fl.isDirectory())
    ListFilesInDirectory(fl.toString());
       else
    System.out.println(fl.toString());
   }
      }

你可能感兴趣的:(File)