From c2b8d2333c28ccb68631d7b29a7f94cfd31dbd02 Mon Sep 17 00:00:00 2001 From: Hccake Date: Fri, 11 Jun 2021 00:47:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:bug:=20fix=20=E5=BD=93=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=8A=A0=E5=AF=86=E5=AF=BC=E5=87=BA=E6=97=B6=EF=BC=8C=E7=94=B1?= =?UTF-8?q?=E4=BA=8E=E8=BE=93=E5=87=BA=E6=B5=81=E6=9C=AA=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E6=96=87=E4=BB=B6=E6=8D=9F=E5=9D=8F?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/alibaba/excel/context/WriteContextImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java index c1f89f02..5b4efb18 100644 --- a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java +++ b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java @@ -488,14 +488,18 @@ public class WriteContextImpl implements WriteContext { Encryptor encryptor = new EncryptionInfo(EncryptionMode.standard).getEncryptor(); encryptor.confirmPassword(writeWorkbookHolder.getPassword()); OPCPackage opcPackage = null; + OutputStream outputStream = null; try { opcPackage = OPCPackage.open(file, PackageAccess.READ_WRITE); - OutputStream outputStream = encryptor.getDataStream(fileSystem); + outputStream = encryptor.getDataStream(fileSystem); opcPackage.save(outputStream); } finally { if (opcPackage != null) { opcPackage.close(); } + if (outputStream != null) { + outputStream.close(); + } } return fileSystem; } From ad14f28d277538fb42dacc8d420b3a93caf0f9e6 Mon Sep 17 00:00:00 2001 From: Hccake Date: Fri, 11 Jun 2021 01:21:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?:arrow=5Fup:=20=E5=8D=87=E7=BA=A7=20poi=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 9f1a4c72..251651e9 100644 --- a/pom.xml +++ b/pom.xml @@ -57,20 +57,10 @@ - - org.apache.poi - poi - 3.17 - org.apache.poi poi-ooxml - 3.17 - - - org.apache.poi - poi-ooxml-schemas - 3.17 + 4.1.2 cglib