diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2018-07-16 17:55:58 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-07-16 17:55:58 +0000 |
commit | 6a10ebebb37fd09492aa0fe4a5e05db68d078ac8 (patch) | |
tree | 3fb6e0d34a92276f420c36f170fdb4fff61e39a5 | |
parent | f53cadde4bd889e1b33df14c1aa4de76ced2b82f (diff) | |
parent | 615725b3dea2275b00d07be9aecbfbb320001ef0 (diff) |
Merge "Fix potential errors in ASDCController"
-rw-r--r-- | asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java index c452089425..867efd5840 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCController.java @@ -492,17 +492,17 @@ public class ASDCController { try {
LOGGER.info(MessageEnum.ASDC_RECEIVE_SERVICE_NOTIF, "***WRITE FILE ARTIFACT NAME", "ASDC", artifact.getArtifactName());
- FileOutputStream outFile = new FileOutputStream(System.getProperty("mso.config.path") + "/ASDC" + "/" + artifact.getArtifactName());
- outFile.write(payloadBytes, 0, payloadBytes.length);
- outFile.close();
- } catch (Exception e) {
- LOGGER.debug("Exception :",e);
- LOGGER.error(MessageEnum.ASDC_ARTIFACT_DOWNLOAD_FAIL,
- artifact.getArtifactName (),
- artifact.getArtifactURL (),
- artifact.getArtifactUUID (),
- resultArtifact.getDistributionMessageResult (), "", "", MsoLogger.ErrorCode.DataError, "ASDC write to file failed");
- }
+ try (FileOutputStream outFile = new FileOutputStream(System.getProperty("mso.config.path") + "/ASDC" + "/" + artifact.getArtifactName())) {
+ outFile.write(payloadBytes, 0, payloadBytes.length);
+ }
+ } catch (Exception e) {
+ LOGGER.debug("Exception :",e);
+ LOGGER.error(MessageEnum.ASDC_ARTIFACT_DOWNLOAD_FAIL,
+ artifact.getArtifactName (),
+ artifact.getArtifactURL (),
+ artifact.getArtifactUUID (),
+ resultArtifact.getDistributionMessageResult (), "", "", MsoLogger.ErrorCode.DataError, "ASDC write to file failed");
+ }
}
|