void (@NotNull File dir, boolean asynchronously) { if (!asynchronously) { FileUtil.delete(dir); return; } LOG.info("Deleting asynchronously... " + dir.getPath()); try { File temp = getEmptyTempDir(); Path moved = Files.move(dir.toPath(), temp.toPath()); EXECUTOR_SERVICE.execute(() -> delete(moved)); } catch (IOException e) { LOG.warn("Unable to move directory: " + e.getMessage()); FileUtil.delete(dir); } }