private static void recursiveDelete(final Path path, final AtomicBoolean success) {
        try {
            Files.walkFileTree(
                    path,
                    EnumSet.of(FileVisitOption.FOLLOW_LINKS),
                    Integer.MAX_VALUE,
                    new AbstractFileVisitor() {
                        @Override
                        public FileVisitResult visitFile(final Path file,
                                                         final BasicFileAttributes attrs) {
                            deleteIfExists(file, success);
                            return super.visitFile(file, attrs);
                        }

                        @Override
                        public FileVisitResult postVisitDirectory(final Path dir,
                                                                  final IOException exc) {
                            if (!dir.equals(path)) {
                                deleteIfExists(dir, success);
                            }
                            return super.postVisitDirectory(dir, exc);
                        }
                    });
        } catch (final NotDirectoryException e) {
            // Ignore.
        } catch (final IOException e) {
            LOGGER.debug(e.getMessage(), e);
        }
    }
@return True if path contains no files or directories.
@throws IOException if it is unable to list the contents of path
stroom-util/src/main/java/stroom/util/io/FileUtil.java