From ddd3bc2f9f5af05190161aa8058da66e0db81b54 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sat, 19 Feb 2022 19:11:31 +0000 Subject: [PATCH] support specific method to set zip entry max size git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898228 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/openxml4j/util/ZipArchiveFakeEntry.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveFakeEntry.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveFakeEntry.java index 572f7bdc52..807159ba0d 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveFakeEntry.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveFakeEntry.java @@ -39,7 +39,16 @@ import org.apache.poi.util.TempFile; // how large a single entry in a zip-file should become at max // can be overwritten via IOUtils.setByteArrayMaxOverride() - private static final int MAX_ENTRY_SIZE = 100_000_000; + private static final int DEFAULT_MAX_ENTRY_SIZE = 100_000_000; + private static int MAX_ENTRY_SIZE = DEFAULT_MAX_ENTRY_SIZE; + + public static void setMaxEntrySize(int maxEntrySize) { + MAX_ENTRY_SIZE = maxEntrySize; + } + + public static int getMaxEntrySize() { + return MAX_ENTRY_SIZE; + } private byte[] data; private File tempFile; -- 2.39.5