diff options
Diffstat (limited to 'artifactbroker/plugins/reception-plugins/src')
-rw-r--r-- | artifactbroker/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/artifactbroker/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java b/artifactbroker/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java index 37fb314..8bf69da 100644 --- a/artifactbroker/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java +++ b/artifactbroker/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java @@ -338,10 +338,8 @@ public class SdcReceptionHandler extends AbstractReceptionHandler implements INo private static void writeFileByFileWriter(String filePath, String content) throws IOException { File file = new File(filePath); synchronized (file) { - try { - FileWriter fw = new FileWriter(filePath); + try (FileWriter fw = new FileWriter(filePath)) { fw.write(content); - fw.close(); } catch (final IOException exp) { LOGGER.error("Failed to write File by File Writer ", exp); } |