public class CreateFileDemo {
//满足后缀名查找
private static void deleFile(String path){
File fi = new File(path);
File []files = fi.listFiles();
for(File file:files){
if(file.isDirectory()){
deleFile(file.getAbsolutePath());
}else{
file.delete();
}
}
fi.delete();
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
deleFile("C:\\xiaoshuowu\\org1");
}
}
|
|