aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java4
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);
}