aboutsummaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/main
diff options
context:
space:
mode:
authorManamohan Satapathy <MS00534989@techmahindra.com>2018-12-17 10:33:58 +0530
committerManamohan Satapathy <MS00534989@techmahindra.com>2018-12-17 10:37:55 +0530
commita18c1354055e54c5d9d9b7bdc7cf8542175e7622 (patch)
tree5e199996d45cd18ca9befa2925543141bb2a004f /asdc-controller/src/main
parent90d8bdc280619c6036185a37d4556899b2181e29 (diff)
Use try-with-resources
: Sonar:Blocker BpmnInstaller.java:L163 Change-Id: I20d81f7ef77446e50a4034d755537d1ca0b2d92b Issue-ID: SO-1333 Signed-off-by: Manamohan Satapathy <MS00534989@techmahindra.com>
Diffstat (limited to 'asdc-controller/src/main')
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
index e4a4c7cdfb..486844ae02 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
@@ -158,14 +158,19 @@ public class BpmnInstaller {
return requestEntity;
}
- protected void extractBpmnFileFromCsar(ZipInputStream zipIn, String fileName) throws IOException {
+ /* protected void extractBpmnFileFromCsar(ZipInputStream zipIn, String fileName) throws IOException */
+ protected void extractBpmnFileFromCsar(ZipInputStream zipIn, String fileName) {
String filePath = Paths.get(System.getProperty("mso.config.path"), "ASDC", fileName).normalize().toString();
- BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(filePath));
+ /* BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(filePath)); */
+ try (BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(filePath))){
byte[] bytesIn = new byte[4096];
int read = 0;
while ((read = zipIn.read(bytesIn)) != -1) {
outputStream.write(bytesIn, 0, read);
}
- outputStream.close();
+ /* outputStream.close(); */
+ } catch (IOException e) {
+ LOGGER.error("Unable to open file.", e);
+ }
}
}