diff options
author | Arindam Mondal <arind.mondal@samsung.com> | 2018-07-10 15:11:38 +0900 |
---|---|---|
committer | ONAP <arind.mondal@samsung.com> | 2018-07-10 15:39:58 +0900 |
commit | 16ecee44bc14dcb0a128cfdabf0ae8b17f1db057 (patch) | |
tree | 24c8d7336bdbcf6dc4212a95b633590df9585fd1 /ueb-listener | |
parent | b13fc8a9b134c43a437d7a48ceb509295df4713a (diff) |
Sonar issue fix blocker, critical
Issue-ID: CCSDK-332
Change-Id: I8741cb5bf68d71f0376105d2b1683ac05534a001
Signed-off-by: Arindam Mondal <arind.mondal@samsung.com>
Diffstat (limited to 'ueb-listener')
-rw-r--r-- | ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java index 8ea041e61..4ae5acd99 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java @@ -399,8 +399,7 @@ public class SdncUebCallback implements INotificationCallback { // Save zip if TOSCA_CSAR if (artifact.getArtifactType().contains("TOSCA_CSAR") || artifact.getArtifactName().contains(".csar")) { - try { - FileOutputStream outFile = new FileOutputStream(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName()); + try(FileOutputStream outFile = new FileOutputStream(incomingDir.getAbsolutePath() + "/" + artifact.getArtifactName())) { outFile.write(payloadBytes, 0, payloadBytes.length); outFile.close(); writeSucceeded = true; @@ -411,8 +410,7 @@ public class SdncUebCallback implements INotificationCallback { } else { String payload = new String(payloadBytes); - try { - FileWriter spoolFileWriter = new FileWriter(spoolFile); + try(FileWriter spoolFileWriter = new FileWriter(spoolFile)) { spoolFileWriter.write(payload); spoolFileWriter.close(); writeSucceeded = true; |