MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / rmdir

Method rmdir

onjava/RmDir.java:11–28  ·  view source on GitHub ↗
(Path dir)

Source from the content-addressed store, hash-verified

9
10public class RmDir {
11 public static void rmdir(Path dir)
12 throws IOException {
13 Files.walkFileTree(dir,
14 new SimpleFileVisitor<Path>() {
15 @Override public FileVisitResult
16 visitFile(Path file, BasicFileAttributes attrs)
17 throws IOException {
18 Files.delete(file);
19 return FileVisitResult.CONTINUE;
20 }
21 @Override public FileVisitResult
22 postVisitDirectory(Path dir, IOException exc)
23 throws IOException {
24 Files.delete(dir);
25 return FileVisitResult.CONTINUE;
26 }
27 });
28 }
29}

Callers 1

refreshTestDirMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected