public static Path ensureDirExists(final Path path) {
        if (!Files.isDirectory(path)) {
            LOGGER.info("Creating directory {}", path.normalize().toAbsolutePath());
            try {
                return Files.createDirectories(path);
            } catch (IOException e) {
                throw new RuntimeException("Error creating directory " + path.normalize().toAbsolutePath(), e);
            }
        } else {
            return path;
        }
    }
Similar to {@link Files#createDirectories(Path, FileAttribute[])} but with logging
to log when the dir is created.

@param path The path of the dir to ensure exists
stroom-util/src/main/java/stroom/util/io/FileUtil.java