X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aai%2Fgizmo.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fcrud%2Futil%2FCrudProperties.java;h=118aed3968ebd029f14932f58c5d5f9001f7247f;hp=7d31691de7fce696c622fc33ff3b0f6f487fc708;hb=07c45d4e49c334d11d91bfadbd7b68c437007b01;hpb=68cd3355674d66f8feee3d067960c081581a3911 diff --git a/src/main/java/org/onap/crud/util/CrudProperties.java b/src/main/java/org/onap/crud/util/CrudProperties.java index 7d31691..118aed3 100644 --- a/src/main/java/org/onap/crud/util/CrudProperties.java +++ b/src/main/java/org/onap/crud/util/CrudProperties.java @@ -53,21 +53,11 @@ public class CrudProperties { public static void put(String key, String value) { properties.setProperty(key, value); - FileOutputStream fileOut = null; - try { - fileOut = new FileOutputStream(new File(CrudServiceConstants.CRD_CONFIG_FILE)); + try (FileOutputStream fileOut = new FileOutputStream(new File(CrudServiceConstants.CRD_CONFIG_FILE))) { properties.store(fileOut, "Added property: " + key); } catch (Exception e) { e.printStackTrace(); - } finally { - - try { - fileOut.close(); - } catch (IOException ex) { - ex.printStackTrace(); - } } - }