summaryrefslogtreecommitdiffstats
path: root/ueb-listener
diff options
context:
space:
mode:
Diffstat (limited to 'ueb-listener')
-rw-r--r--ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java6
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;