aboutsummaryrefslogtreecommitdiffstats
path: root/operation-utils/src/main/java/org/openecomp/utils/ConvertMessagePropertiesToYaml.java
diff options
context:
space:
mode:
Diffstat (limited to 'operation-utils/src/main/java/org/openecomp/utils/ConvertMessagePropertiesToYaml.java')
-rw-r--r--operation-utils/src/main/java/org/openecomp/utils/ConvertMessagePropertiesToYaml.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/operation-utils/src/main/java/org/openecomp/utils/ConvertMessagePropertiesToYaml.java b/operation-utils/src/main/java/org/openecomp/utils/ConvertMessagePropertiesToYaml.java
index 28026d6..aa4babf 100644
--- a/operation-utils/src/main/java/org/openecomp/utils/ConvertMessagePropertiesToYaml.java
+++ b/operation-utils/src/main/java/org/openecomp/utils/ConvertMessagePropertiesToYaml.java
@@ -40,7 +40,13 @@ public class ConvertMessagePropertiesToYaml {
Properties props = new Properties();
String pname = "GenericMessages.properties";
String fname = "src/main/resources/GenericMessages.yaml";
- props.load(ConvertMessagePropertiesToYaml.class.getClassLoader().getResourceAsStream(pname));
+ InputStream in = null;
+ try {
+ in = ConvertMessagePropertiesToYaml.class.getClassLoader().getResourceAsStream(pname);
+ props.load(in);
+ } finally {
+ if (in != null) in.close();
+ }
DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
Yaml y = new Yaml(options);