diff options
author | Jorge Hernandez <jh1730@att.com> | 2017-11-02 15:36:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-11-02 15:36:45 +0000 |
commit | fbe40f4555f25745dbadd73d43ae299c6421adcf (patch) | |
tree | 2eb6c260bc53c3fda6beaa601e114997ffb53daa /POLICY-SDK-APP | |
parent | bdbde2a9d168665d9210d6e9fe9987f3c89f5374 (diff) | |
parent | 0c15051e79291c5907b6c7d1bb331c9d5c95fa6e (diff) |
Merge "Resolved Policy Blocker issue"
Diffstat (limited to 'POLICY-SDK-APP')
-rw-r--r-- | POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java index ff5ccffb0..43b62b0c0 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java @@ -411,23 +411,17 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { } + @SuppressWarnings("unchecked") public Map<String, String> load(String fileName) throws IOException { File newConfiguration = new File(fileName); - InputStream is = null; - try { - is = new FileInputStream(newConfiguration); + Yaml yaml = new Yaml(); + Map<Object, Object> yamlMap = null; + try(InputStream is = new FileInputStream(newConfiguration)){ + yamlMap = (Map<Object, Object>) yaml.load(is); } catch (FileNotFoundException e) { LOGGER.error(e); } - Yaml yaml = new Yaml(); - - Map<Object, Object> yamlMap = null; - try{ - yamlMap = (Map<Object, Object>) yaml.load(is); - }catch(Exception e){ - LOGGER.error("load:", e); - } StringBuilder sb = new StringBuilder(); Map<String, String> settings = new HashMap<>(); if (yamlMap == null) { |