Remove exception-handling code in ZipPackage that was never reached

Here e.getMessage() and e.toString() were compared, which never match

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1871594 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2019-12-15 14:54:03 +00:00
parent 921259fd36
commit ecb42bd78d
1 changed files with 9 additions and 13 deletions

View File

@ -144,11 +144,7 @@ public final class ZipPackage extends OPCPackage {
if (access == PackageAccess.WRITE) {
throw new InvalidOperationException("Can't open the specified file: '" + file + "'", e);
}
// YK: this is incorrect and the exception below is never thrown.
// The could below should catch "archive is not a ZIP archive"
if ("java.util.zip.ZipException: archive is not a ZIP archive".equals(e.getMessage())) {
throw new NotOfficeXmlFileException("archive is not a ZIP archive", e);
}
LOG.log(POILogger.ERROR, "Error in zip file "+file+" - falling back to stream processing (i.e. ignoring zip central directory)");
ze = openZipEntrySourceStream(file);
}