File dir = Test1.gerDir();
str(dir, 0);
}
public static void str(File dir, int a) {
File[] arr = dir.listFiles();
for (File file : arr) {
for (int i = 0; i < a; i++) {
System.out.print("\t");
}
System.out.println(file);
if (file.isDirectory()) {
str(file, a + 1);
}
}
} |
|