自己做的简单工具类
package com.neo.util; import java.io.File; public class Fileutil { public static void fun1(File file) { if (file.isDirectory()) { for (File file2 : file.listFiles()) { fun1(file2); } } System.out.println(file.getName()); } public static void main(String[] args) { File file = new File("e:"+File.separator+"test"); fun1(file); } }