Browse Source

return better error message when ZipEntry has no data (it was closed before the data was retrieved)

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894831 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_5_2_0
PJ Fanning 2 years ago
parent
commit
5a59376389

+ 3
- 1
poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveFakeEntry.java View File

@@ -88,8 +88,10 @@ import org.apache.poi.util.TempFile;
} catch (FileNotFoundException e) {
throw new RuntimeException("temp file " + tempFile.getAbsolutePath() + " is missing");
}
} else {
} else if (data != null) {
return new UnsynchronizedByteArrayInputStream(data);
} else {
throw new RuntimeException("Cannot retrieve data from Zip Entry, probably because the Zip Entry was closed before the data was requested.");
}
}


Loading…
Cancel
Save