Change-Id: Id98e68f70af525adc4894bfe92884a590e32b664
Issue-ID: AAI-1240
Signed-off-by: Switon Tomasz <tomasz.switon@nokia.com>
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();
- }
}
-
}