public static void scanFile(String path
){
File scanPath
= new File(path
);
File
[] fileList
= null
;
if(scanPath
.isDirectory()){
fileList
= scanPath
.listFiles();
}else if(scanPath
.isFile()){
fileList
= new File[]{scanPath
};
}
for (int i
= 0; i
< fileList
.length
; i
++) {
File file
= fileList
[i
];
if(file
.isDirectory()){
scanFile(file
.getPath());
}else if(file
.isFile()){
System
.out
.println(file
.getName());
}
}
}
转载请注明原文地址: https://mac.8miu.com/read-509873.html