You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2024/02/20 16:31:05 UTC

svn commit: r1915895 - /poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java

Author: fanningpj
Date: Tue Feb 20 16:31:04 2024
New Revision: 1915895

URL: http://svn.apache.org/viewvc?rev=1915895&view=rev
Log:
try to fix issue with invalid files after commons-compress upgrade

Modified:
    poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java

Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java?rev=1915895&r1=1915894&r2=1915895&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java Tue Feb 20 16:31:04 2024
@@ -155,7 +155,9 @@ public class ZipArchiveThresholdInputStr
             }
             return entry;
         } catch (ZipException ze) {
-            if (ze.getMessage().startsWith("Unexpected record signature")) {
+            final String msg = ze.getMessage();
+            if (msg.startsWith("Unexpected record signature")
+                    || msg.startsWith("Cannot find zip signature within the file")) {
                 throw new NotOfficeXmlFileException(
                         "No valid entries or contents found, this is not a valid OOXML (Office Open XML) file", ze);
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org