MCPcopy Create free account
hub / github.com/0opslab/opslabJutil / deleteDir

Method deleteDir

src/main/java/com/opslab/util/FileUtil.java:431–443  ·  view source on GitHub ↗

删除一个目录 @param file 需要处理的文件 @return 是否成功

(File file)

Source from the content-addressed store, hash-verified

429 * @return 是否成功
430 */
431 public final static boolean deleteDir(File file) {
432 List<File> files = listFileAll(file);
433 if (CheckUtil.valid(files)) {
434 for (File f : files) {
435 if (f.isDirectory()) {
436 deleteDir(f);
437 } else {
438 deleteFile(f);
439 }
440 }
441 }
442 return file.delete();
443 }
444
445
446 /**

Callers 2

testDeleteDirMethod · 0.95
testDeleteDirMethod · 0.95

Calls 4

listFileAllMethod · 0.95
validMethod · 0.95
deleteFileMethod · 0.95
deleteMethod · 0.80

Tested by 2

testDeleteDirMethod · 0.76
testDeleteDirMethod · 0.76