poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1839197 - in /poi/trunk/src/java/org/apache/poi: sl/usermodel/SlideShowFactory.java ss/usermodel/WorkbookFactory.java
Date Sun, 26 Aug 2018 11:41:20 GMT
Author: centic
Date: Sun Aug 26 11:41:20 2018
New Revision: 1839197

URL: http://svn.apache.org/viewvc?rev=1839197&view=rev
Log:
Ensure that file handles are closed for encrypted files

Modified:
    poi/trunk/src/java/org/apache/poi/sl/usermodel/SlideShowFactory.java
    poi/trunk/src/java/org/apache/poi/ss/usermodel/WorkbookFactory.java

Modified: poi/trunk/src/java/org/apache/poi/sl/usermodel/SlideShowFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/usermodel/SlideShowFactory.java?rev=1839197&r1=1839196&r2=1839197&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/usermodel/SlideShowFactory.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/usermodel/SlideShowFactory.java Sun Aug 26 11:41:20
2018
@@ -110,6 +110,10 @@ public class SlideShowFactory {
                 return createXSLFSlideShow(stream);
             } finally {
                 IOUtils.closeQuietly(stream);
+
+                // as we processed the full stream already, we can close the filesystem here
+                // otherwise file handles are leaked
+                root.getFileSystem().close();
             }
         }
 

Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/WorkbookFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/WorkbookFactory.java?rev=1839197&r1=1839196&r2=1839197&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/WorkbookFactory.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/WorkbookFactory.java Sun Aug 26 11:41:20
2018
@@ -110,6 +110,10 @@ public class WorkbookFactory {
                 return createXSSFWorkbook(stream);
             } finally {
                 IOUtils.closeQuietly(stream);
+
+                // as we processed the full stream already, we can close the filesystem here
+                // otherwise file handles are leaked
+                root.getFileSystem().close();
             }
         }
 
@@ -137,7 +141,7 @@ public class WorkbookFactory {
      * <p>Note that in order to properly release resources the
      *  Workbook should be closed after use.</p>
      *
-     *  @param pkg The {@link OPCPackage} opened for reading data.
+     *  @param pkg The {@link org.apache.poi.openxml4j.opc.OPCPackage} opened for reading
data.
      *
      *  @return The created Workbook
      *



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message