aboutsummaryrefslogtreecommitdiffstats
path: root/ONAP-PAP-REST/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'ONAP-PAP-REST/src/main/java')
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/OptimizationConfigPolicy.java8
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);