diff options
author | Jorge Hernandez <jh1730@att.com> | 2018-04-12 16:04:49 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-04-12 16:04:49 +0000 |
commit | da09b036ff8f3c927e552e33e1476be4ba488efa (patch) | |
tree | b5a7e329aa7ef48cacc76e092370dfc51b92d553 | |
parent | 214338aa61978daf5c169f02c4c0e56527a3f90d (diff) | |
parent | 882850a0f5a147c45749facf2e78bccafce1760d (diff) |
Merge "OOF Policy Config File Creation Issue"v1.2.0
-rw-r--r-- | ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/OptimizationConfigPolicy.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/OptimizationConfigPolicy.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/OptimizationConfigPolicy.java index 2a03482d2..18d588c8f 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/OptimizationConfigPolicy.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/OptimizationConfigPolicy.java @@ -88,10 +88,12 @@ public class OptimizationConfigPolicy extends Policy { //save configuration of the policy based on the policyname private void saveConfigurations(String policyName, String jsonBody) { + + if(policyName.endsWith(".xml")){ + policyName = policyName.replace(".xml", ""); + } + try (PrintWriter out = new PrintWriter(CONFIG_HOME + File.separator + policyName +".json");){ - if(policyName.endsWith(".xml")){ - policyName = policyName.replace(".xml", ""); - } out.println(jsonBody); } catch (Exception e) { LOGGER.error("Exception Occured While writing Configuration data"+e); |