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: [email protected]
For additional commands, e-mail: [email protected]