static void cloneZipFileWithUpdatedMeta(final AttributeMap attributeMap,
                                            final FeedKey defaultFeedKey,
                                            final FeedKeyInterner feedKeyInterner,
                                            final Map<String, ZipEntryGroup> baseNameToGroupMap,
                                            final ProxyZipValidator validator,
                                            final List<Entry> dataEntries,
                                            final Path stagingZipFilePath,
                                            final Path zipFilePath) throws IOException {

        LOGGER.debug("cloneZipFileWithUpdateMeta() - START defaultFeedKey: '{}', " +
                     "stagingZipFilePath: {}, zipFilePath: {}",
                defaultFeedKey, stagingZipFilePath, zipFilePath);

        final AtomicLong totalUncompressedSize = new AtomicLong();
        final DurationTimer timer = LogUtil.startTimerIfDebugEnabled(LOGGER);
        // Read the entries from the staging zip and write them to the
        try (final ZipWriter zipWriter = new ZipWriter(zipFilePath, LocalByteBuffer.get())) {
            ZipUtil.forEachEntry(stagingZipFilePath, (stagingZip, entry) -> {
                final long size = cloneZipEntry(
                        defaultFeedKey,
                        feedKeyInterner,
                        attributeMap,
                        stagingZip,
                        entry,
                        validator,
                        zipWriter,
                        baseNameToGroupMap,
                        dataEntries);
                totalUncompressedSize.addAndGet(size);
            });
        } finally {
            try {
                Files.delete(stagingZipFilePath);
            } catch (IOException e) {
                LOGGER.error("Error deleting stagingZipFilePath {}, msg: {}",
                        stagingZipFilePath, LogUtil.exceptionMessage(e), e);
            }
        }

        LOGGER.debug("cloneZipFileWithUpdateMeta() - START defaultFeedKey: '{}', " +
                     "stagingZipFilePath: {}, zipFilePath: {}, totalUncompressedSize: {}, duration: {}",
                defaultFeedKey, stagingZipFilePath, zipFilePath, totalUncompressedSize, timer);
    }
Static and pkg private to aid testing
stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/handler/ZipReceiver.java