diff options
author | PJ Fanning <fanningpj@apache.org> | 2023-10-26 17:37:46 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2023-10-26 17:37:46 +0000 |
commit | ff5fc9d582844c7737582de8e20671e7c16faaf0 (patch) | |
tree | c5d8844b7de6fe5d2f060dc1427fe1e9b3defa9a /poi-ooxml/src/main | |
parent | bcfd81f489670ace3304ee68934f24143c9f517d (diff) | |
download | poi-ff5fc9d582844c7737582de8e20671e7c16faaf0.tar.gz poi-ff5fc9d582844c7737582de8e20671e7c16faaf0.zip |
[bug-67579] revert changes - POI will again close the InputStream
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1913356 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml/src/main')
3 files changed, 1 insertions, 37 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackage.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackage.java index cf0202e3ad..2eb59e32f9 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackage.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackage.java @@ -131,9 +131,6 @@ public final class ZipPackage extends OPCPackage { super(access); try (ZipArchiveThresholdInputStream zis = ZipHelper.openZipStream(in)) { this.zipArchive = new ZipInputStreamZipEntrySource(zis); - } catch (final IOException | RuntimeException e) { - IOUtils.closeQuietly(in); - throw e; } } diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/NoCloseInputStream.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/NoCloseInputStream.java deleted file mode 100644 index b27685aab2..0000000000 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/NoCloseInputStream.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ - -package org.apache.poi.openxml4j.opc.internal; - -import org.apache.poi.util.Internal; - -import java.io.FilterInputStream; -import java.io.InputStream; - -@Internal -final class NoCloseInputStream extends FilterInputStream { - NoCloseInputStream(InputStream stream) { - super(stream); - } - - @Override - public void close() {} -} diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ZipHelper.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ZipHelper.java index 7622b28b5c..26f3cffae1 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ZipHelper.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ZipHelper.java @@ -176,7 +176,7 @@ public final class ZipHelper { verifyZipHeader(checkedStream); // Open as a proper zip stream - return new ZipArchiveThresholdInputStream(new ZipArchiveInputStream(new NoCloseInputStream(checkedStream))); + return new ZipArchiveThresholdInputStream(new ZipArchiveInputStream(checkedStream)); } /** |