public void add(final Path sourceDir) {
        Objects.requireNonNull(sourceDir);
        if (Files.isDirectory(sourceDir)) {
            try {
                // We will move before delete to help ensure we don't end up partially deleting dir contents in place.
                // Make sure we get a unique dir name.
                final Path deleteDir = dir.resolve(StringIdUtil.idToString(count.incrementAndGet()));
                LOGGER.debug("Moving {} => {}", sourceDir, deleteDir);
                Files.move(sourceDir, deleteDir, StandardCopyOption.ATOMIC_MOVE);
                LOGGER.debug("Deleting {} and its contents", deleteDir);
                FileUtil.deleteDir(deleteDir);
            } catch (final Exception e) {
                LOGGER.error(() -> "Failed to cleanup dir: " + FileUtil.getCanonicalPath(sourceDir), e);
            }
        } else {
            if (Files.exists(sourceDir)) {
                LOGGER.debug("sourceDir {} is not a directory", sourceDir);
            } else {
                LOGGER.debug("sourceDir {} does not exist", sourceDir);
            }
        }
    }
Synchronously move sourceDir then delete it and its contents.
Swallows all exceptions.
stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/handler/CleanupDirQueue.java