private void ensureDirectoryExists(final Path path)
            throws IOException {

        if (!path.toFile().exists()) {
            if (!path.toFile().mkdirs()) {
                throw new IOException("Could not create directories '"
                                      + path
                                      + "' for GIT document");
            }
        }
    }
Ensures that the given path exists. The path is assumed to be all
directories - there is no terminal filename at the end.

@param path The path of directories that should exist.
@throws IOException If the directories could not be created.
stroom-gitrepo/stroom-gitrepo-impl/src/main/java/stroom/gitrepo/impl/GitRepoStorageService.java