aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2017-11-23 20:03:25 +0000
committerPJ Fanning <fanningpj@apache.org>2017-11-23 20:03:25 +0000
commite0c8416726efa9ca12e0791aa89295c9e7964cde (patch)
tree4fb344e6046005d88413bab2c429fd221a82796a /src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java
parent61cad2865eeb9dff5664ceb47a4e088fe8827b01 (diff)
downloadpoi-e0c8416726efa9ca12e0791aa89295c9e7964cde.tar.gz
poi-e0c8416726efa9ca12e0791aa89295c9e7964cde.zip
use try with resources in examples
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1816189 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java')
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java
index e3ac6d22a1..b4f2024a24 100644
--- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java
+++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java
@@ -87,14 +87,10 @@ public class XSSFBReader extends XSSFReader {
* @throws IOException when there's a problem with the workbook part's stream
*/
public String getAbsPathMetadata() throws IOException {
- InputStream is = null;
- try {
- is = workbookPart.getInputStream();
- PathExtractor p = new PathExtractor(workbookPart.getInputStream());
+ try (InputStream is = workbookPart.getInputStream()) {
+ PathExtractor p = new PathExtractor(is);
p.parse();
return p.getPath();
- } finally {
- IOUtils.closeQuietly(is);
}
}