private NumberedDirProvider createDirProvider(final DataDirProvider dataDirProvider,
                                                  final String dirName) {
        // Make dir
        final Path dir = dataDirProvider.get().resolve(dirName);
        DirUtil.ensureDirExists(dir);

        // This is a temporary location and can be cleaned completely on startup.
        if (!FileUtil.deleteContents(dir)) {
            LOGGER.error(() -> "Failed to delete contents of " + FileUtil.getCanonicalPath(dir));
        }
        return new NumberedDirProvider(dir);
    }
Pkg private to ease testing. splitDirConsumer also there to aid testing.
stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/handler/ZipSplitter.java