标签:
1 private void deleteDirectory(File file) { 2 if (file.isFile()) { 3 file.delete(); 4 return; 5 } 6 7 if(file.isDirectory()){ 8 File[] childFiles = file.listFiles(); 9 if (childFiles == null || childFiles.length == 0) { 10 file.delete(); 11 return; 12 } 13 14 for (int i = 0; i < childFiles.length; i++) { 15 deleteDirectory(childFiles[i]); 16 } 17 file.delete(); 18 } 19 }
标签:
原文地址:http://www.cnblogs.com/eustoma/p/4459036.html