private static void deleteDir()

in src/main/java/com/spotify/fmt/ForkingExecutor.java [275:302]


  private static void deleteDir(Path path) throws IOException {
    try {
      Files.walkFileTree(
          path,
          new SimpleFileVisitor<Path>() {
            @Override
            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
                throws IOException {
              try {
                Files.delete(file);
              } catch (NoSuchFileException ignore) {
              }
              return FileVisitResult.CONTINUE;
            }

            @Override
            public FileVisitResult postVisitDirectory(Path dir, IOException exc)
                throws IOException {
              try {
                Files.delete(dir);
              } catch (NoSuchFileException ignore) {
              }
              return FileVisitResult.CONTINUE;
            }
          });
    } catch (NoSuchFileException ignore) {
    }
  }