Ensure that file handles are closed for encrypted files
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1839197 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
eaea81bfa8
commit
522c33358b
@ -110,6 +110,10 @@ public class SlideShowFactory {
|
|||||||
return createXSLFSlideShow(stream);
|
return createXSLFSlideShow(stream);
|
||||||
} finally {
|
} finally {
|
||||||
IOUtils.closeQuietly(stream);
|
IOUtils.closeQuietly(stream);
|
||||||
|
|
||||||
|
// as we processed the full stream already, we can close the filesystem here
|
||||||
|
// otherwise file handles are leaked
|
||||||
|
root.getFileSystem().close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,6 +110,10 @@ public class WorkbookFactory {
|
|||||||
return createXSSFWorkbook(stream);
|
return createXSSFWorkbook(stream);
|
||||||
} finally {
|
} finally {
|
||||||
IOUtils.closeQuietly(stream);
|
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
|
* <p>Note that in order to properly release resources the
|
||||||
* Workbook should be closed after use.</p>
|
* 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
|
* @return The created Workbook
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user