static List<Path> splitZip(final Path zipFilePath,
                               final AttributeMap attributeMap,
                               final Map<FeedKey, List<ZipEntryGroup>> allowedEntries,
                               final Path outputParentDir) throws IOException {
        LOGGER.debug("splitZip() - START zipFilePath: {}, outputParentDir: {}", zipFilePath, outputParentDir);
        final List<Path> groupDirs = new ArrayList<>();
        final DurationTimer timer = LogUtil.startTimerIfDebugEnabled(LOGGER);
        long id = 1;
        try (final ZipFile zipFile = ZipUtil.createZipFile(zipFilePath)) {
            // Only the entries in the map are to be included in the splits, so iterate over it
            // then copy all the entries for that feedKey from the source zip into the dest zip.
            final byte[] buffer = LocalByteBuffer.get();
            for (final Map.Entry<FeedKey, List<ZipEntryGroup>> entry : allowedEntries.entrySet()) {
                final FeedKey feedKey = entry.getKey();
                final List<ZipEntryGroup> zipEntryGroups = entry.getValue();
//                final String name = SPLIT_DIR_PREFIX + NumericFileNameUtil.create(id++);
                final String name = DirUtil.makeSafeName(feedKey);
                final Path groupDir = outputParentDir.resolve(name);
                Files.createDirectory(groupDir);
                final FileGroup fileGroup = new FileGroup(groupDir);
                groupDirs.add(groupDir);

                writeSplitToZip(zipFile, zipEntryGroups, feedKey, attributeMap, fileGroup, buffer);
            }
        }
        LOGGER.debug(() -> LogUtil.message(
                "splitZip() - FINISH zipFilePath: {}, outputParentDir: {}, groupDirs count: {}, " +
                "feedGroups count: {}, duration: {}",
                zipFilePath, outputParentDir, groupDirs.size(), allowedEntries.size(), timer));
        return groupDirs;
    }
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