/**
* 递归删除目录及子文件
* @param file 删除的文件或目录
*/
public static void deleteFiles(File file) throws Exception{
File[] list = file.listFiles();
if (list != null) {
for (File tempFile : list) {
deleteFiles(tempFile); // 递归调用
}
}
boolean isSuccess = file.delete(); // 删除文件
System.out.printf("删除:" + file + ",isSuccess=" + isSuccess);
}