我想实现对文件夹的遍历输出,递归向下遍历输出
package TestIO;
import java.io.File;
public class TestIOFile {
public static void main(String[] args) {
File path = new File("G:\\eclipse\\workspace\\muke");
new TestIOFile().ss(path);
}
public void ss(File path) {
File fl;
for (String st : path.list()) {
fl = new File(st);
if (fl.isDirectory()) {
ss(fl);
} else {
System.out.println(st);
}
}
}
}