diff options
author | Maxim Valyanskiy <maxcom@apache.org> | 2012-03-20 11:21:23 +0000 |
---|---|---|
committer | Maxim Valyanskiy <maxcom@apache.org> | 2012-03-20 11:21:23 +0000 |
commit | 9fb8683aa383e26a741b19213699452a3dcecc17 (patch) | |
tree | 321421547a300bc13adcb04e9e930e02990ddd97 /src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java | |
parent | e191cb70fa2b148e9d1e1657a06788e22ae6031e (diff) | |
download | poi-9fb8683aa383e26a741b19213699452a3dcecc17.tar.gz poi-9fb8683aa383e26a741b19213699452a3dcecc17.zip |
OPC: add original IOException to chain on open file errors
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1302840 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java')
-rw-r--r-- | src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java index bc65412bc7..5ac16d3a0b 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java @@ -98,10 +98,15 @@ public final class ZipPackage extends Package { ZipPackage(String path, PackageAccess access) { super(access); - ZipFile zipFile = ZipHelper.openZipFile(path); - if (zipFile == null) - throw new InvalidOperationException( - "Can't open the specified file: '" + path + "'"); + ZipFile zipFile = null; + + try { + zipFile = ZipHelper.openZipFile(path); + } catch (IOException e) { + throw new InvalidOperationException( + "Can't open the specified file: '" + path + "'", e); + } + this.zipArchive = new ZipFileZipEntrySource(zipFile); } |