diff options
author | PJ Fanning <fanningpj@apache.org> | 2024-02-20 16:31:04 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2024-02-20 16:31:04 +0000 |
commit | 3817f138f8f84126b09f9ed01fe8f93760b6b33f (patch) | |
tree | 765dfd7712683e65c38056c4fb603ea5a2df6c0d /poi-ooxml/src | |
parent | fded4957dbafb8be700c4b26b9e593f3a140488b (diff) | |
download | poi-3817f138f8f84126b09f9ed01fe8f93760b6b33f.tar.gz poi-3817f138f8f84126b09f9ed01fe8f93760b6b33f.zip |
try to fix issue with invalid files after commons-compress upgrade
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1915895 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml/src')
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java index 75e896e78b..6c65589ddc 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java @@ -155,7 +155,9 @@ public class ZipArchiveThresholdInputStream extends FilterInputStream { } 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); } |