递归删除文件夹
public static void delete(File file) {
if(!file.exists()){
return;
}
if(file.isFile() || file.list()==null) {
file.delete();
System.out.println("删除了"+file.getName());
}else {
File[] files = file.listFiles();
for(File a:files) {
delete(a);
}
file.delete();
System.out.println("删除了"+file.getName());
}
}