private Path getLibraryExtractDir(final LmdbLibraryConfig lmdbLibraryConfig) {
        String extractDirStr = lmdbLibraryConfig.getSystemLibraryExtractDir();

        final String extractDirPropName = lmdbLibraryConfig.getFullPathStr(LmdbLibraryConfig.EXTRACT_DIR_PROP_NAME);

        Path extractDir;
        if (extractDirStr == null) {
            LOGGER.warn("LMDB system library extract dir is not set ({}), falling back to temporary directory {}.",
                    extractDirPropName,
                    tempDirProvider.get());

            extractDir = tempDirProvider.get();
            Objects.requireNonNull(extractDir, "Temp dir is not set");
            extractDir = extractDir.resolve(LmdbLibraryConfig.DEFAULT_LIBRARY_EXTRACT_SUB_DIR_NAME);
        } else {
            extractDir = pathCreator.toAppPath(extractDirStr);
        }

        try {
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Ensuring directory {} exists (from configuration property {})",
                        extractDir.toAbsolutePath(),
                        extractDirPropName);
            }
            Files.createDirectories(extractDir);
        } catch (IOException e) {
            throw new RuntimeException(
                    LogUtil.message("Error ensuring directory {} exists (from configuration property {})",
                            extractDir.toAbsolutePath(),
                            extractDirPropName), e);
        }

        if (!Files.isReadable(extractDir)) {
            throw new RuntimeException(
                    LogUtil.message("Directory {} (from configuration property {}) is not readable",
                            extractDir.toAbsolutePath(),
                            extractDirPropName));
        }

        if (!Files.isWritable(extractDir)) {
            throw new RuntimeException(
                    LogUtil.message("Directory {} (from configuration property {}) is not writable",
                            extractDir.toAbsolutePath(),
                            extractDirPropName));
        }

        return extractDir;
    }
Relies on this class being a singleton
stroom-lmdb/src/main/java/stroom/lmdb/LmdbLibrary.java