summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/aai/modelloader/notification/NotificationPublisher.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/aai/modelloader/notification/NotificationPublisher.java')
-rw-r--r--src/main/java/org/onap/aai/modelloader/notification/NotificationPublisher.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/onap/aai/modelloader/notification/NotificationPublisher.java b/src/main/java/org/onap/aai/modelloader/notification/NotificationPublisher.java
index 7ad552b..6e6ff13 100644
--- a/src/main/java/org/onap/aai/modelloader/notification/NotificationPublisher.java
+++ b/src/main/java/org/onap/aai/modelloader/notification/NotificationPublisher.java
@@ -21,6 +21,7 @@
package org.onap.aai.modelloader.notification;
import java.io.IOException;
+import java.io.InputStream;
import java.nio.file.Files;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
@@ -50,8 +51,8 @@ public class NotificationPublisher {
public NotificationPublisher() {
Properties configProperties = new Properties();
- try {
- configProperties.load(Files.newInputStream(ModelLoaderConfig.propertiesFile()));
+ try (InputStream configInputStream = Files.newInputStream(ModelLoaderConfig.propertiesFile())) {
+ configProperties.load(configInputStream);
} catch (IOException e) {
String errorMsg = "Failed to load configuration: " + e.getMessage();
logger.error(ModelLoaderMsgs.DISTRIBUTION_EVENT_ERROR, e, errorMsg);