public boolean deleteAllFile(String Path) {
try {
File path = new File(Path);// 查询路径
String[] strList;// 存放所有查询结果
int i = 0;
strList = path.list();// 执行查询
for (i = 0; i < strList.length; i++) {
System.out.println(strList[i]);// 输出这个文件或者目录的名称
String fileTree = Path + "/" + strList[i];// 确定真实路径
File turePath = new File(fileTree);
turePath.delete();// 删除成功为ture
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}