public static void mkdirs(final Path dir) {
        if (!Files.isDirectory(dir)) {
            if (!doMkdirs(null, dir, MKDIR_RETRY_COUNT)) {
                throw new FileUtilException("Unable to make directory: " + FileUtil.getCanonicalPath(dir));
            }

            if (!Files.isDirectory(dir)) {
                throw new FileUtilException("Directory not found: " + FileUtil.getCanonicalPath(dir));
            }
        }
    }
<p>
Utility method to create directories one by one (rather than call Java
API mkdirs). We do this to ensure if we fail to make one we check that it
has not been created between that last time we checked.
</p>
<p>
<p>
WE ASSUME here that mkdir is ATOMIC .... which it is.
</p>
stroom-data/stroom-data-store-impl-fs/src/main/java/stroom/data/store/impl/fs/FileSystemUtil.java