static int count = 0;
public static void deleteFile(String path) {
if(path == null) {
return;
}
File file = new File(path);
if(!file.exists()) {
return;
}
if(!file.isDirectory()) {
count ++;
file.delete();
return;
}
File[] fileList = file.listFiles();
for(File fc : fileList) {
deleteFile(fc.getAbsolutePath());
}
file.delete();
count ++;
}