public static void main(String[] args) {
File f = new File("D:\test\fsd");
listChids(f,0);
}
public static void listChids(File f,int level){
String preSrt = "";
for(int i=0;ilevel;i++){
preSrt += "----";
}
System.out.println(preSrt+f.getName());
if(!f.isDirectory()){
return ;
}else{
File[] fs = f.listFiles();
for(int i=0;ifs.length;i++){
listChids(fs[i], level+1);
}
}
}