Skip to content

Commit d9da2c7

Browse files
committed
Prevent POI from closing the input stream.
1 parent 0cdf75f commit d9da2c7

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<classpathentry kind="lib" path="lib/sqlite-jdbc-3.8.10.1.jar"/>
1010
<classpathentry kind="lib" path="lib/rtfparserkit-1.10.0.jar"/>
1111
<classpathentry kind="lib" path="lib/commons-collections4-4.1.jar"/>
12-
<classpathentry kind="lib" path="lib/poi-3.17.jar"/>
12+
<classpathentry kind="lib" path="lib/poi-3.17.jar" sourcepath="C:/java/poi-3.17/src"/>
1313
<classpathentry kind="output" path="classes"/>
1414
</classpath>

maven/src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<action dev="joniles" type="update">Handle MSPDI files with varying namespaces.</action>
1212
<action dev="joniles" type="update">Improve robustness Merlin file reader.</action>
1313
<action dev="joniles" type="update">Improve extraction of task start and finish dates from PMXML files only containing partial data.</action>
14+
<action dev="joniles" type="update">Prevent POI from closing the input stream.</action>
1415
</release>
1516
<release date="11/10/2017" version="6.2.1">
1617
<action dev="joniles" type="update">Gracefully handle corrupt MPP files.</action>

src/net/sf/mpxj/reader/UniversalProjectReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ private ProjectFile readProjectFile(ProjectReader reader, File file) throws MPXJ
288288
*/
289289
private ProjectFile handleOleCompoundDocument(InputStream stream) throws Exception
290290
{
291-
POIFSFileSystem fs = new POIFSFileSystem(stream);
291+
POIFSFileSystem fs = new POIFSFileSystem(POIFSFileSystem.createNonClosingInputStream(stream));
292292
MPPReader reader = new MPPReader();
293293
String fileFormat = reader.getFileFormat(fs);
294294
if (fileFormat.startsWith("MSProject"))

0 commit comments

Comments
 (0)