From: Jorge Hernandez Date: Thu, 12 Apr 2018 16:04:49 +0000 (+0000) Subject: Merge "OOF Policy Config File Creation Issue" X-Git-Tag: v1.2.0 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Ftags%2Fv1.2.0;hp=214338aa61978daf5c169f02c4c0e56527a3f90d;p=policy%2Fengine.git Merge "OOF Policy Config File Creation Issue" --- 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);