From 14ea6dbba89b6a3bd6424c1807a02b635d0c67ca Mon Sep 17 00:00:00 2001 From: inoshperera Date: Sat, 15 Sep 2018 17:44:13 +0530 Subject: [PATCH] fixing conflicts --- .../application/mgt/core/util/ArtifactsParser.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ArtifactsParser.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ArtifactsParser.java index 899af7aa37..a696c46640 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ArtifactsParser.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ArtifactsParser.java @@ -38,6 +38,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.UUID; +import java.nio.file.Files; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -120,16 +121,11 @@ public class ArtifactsParser { throw new ParsingException("Error while parsing the file.", e); } finally { if (tempFile != null) { - tempFile.delete(); - } - try { - if (out != null) { - out.close(); - } - if (stream != null) { - stream.close(); + try { + Files.delete(tempFile.toPath()); + } catch (IOException e) { + log.error("Error occured while deleting the temp file", e); } - } catch (IOException e) { } }