Fix bug #52665 - When reading from a ZipFileZipEntrySource that has already been closed, give IllegalArgumentException rather than NPE

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1244450 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2012-02-15 11:51:06 +00:00
parent ccddafaf5c
commit 52e8997b18
2 changed files with 7 additions and 0 deletions

View File

@ -34,6 +34,7 @@
<changes>
<release version="3.8-beta6" date="2012-??-??">
<action dev="poi-developers" type="fix">52665 - When reading from a ZipFileZipEntrySource that has already been closed, give IllegalArgumentException rather than NPE</action>
<action dev="poi-developers" type="fix">52664 - MAPIMessage may not always have name chunks when checking for 7 bit encodings</action>
<action dev="poi-developers" type="fix">52649 - fixed namespace issue in WordToFoConverter</action>
<action dev="poi-developers" type="fix">52385 - avoid trancated array and vector data when reading OLE properties</action>

View File

@ -41,10 +41,16 @@ public class ZipFileZipEntrySource implements ZipEntrySource {
}
public Enumeration<? extends ZipEntry> getEntries() {
if (zipArchive == null)
throw new IllegalStateException("Zip File is closed");
return zipArchive.entries();
}
public InputStream getInputStream(ZipEntry entry) throws IOException {
if (zipArchive == null)
throw new IllegalStateException("Zip File is closed");
return zipArchive.getInputStream(entry);
}
}