aboutsummaryrefslogtreecommitdiffstats
path: root/ONAP-PAP-REST/src
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2018-04-12 16:04:49 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-12 16:04:49 +0000
commitda09b036ff8f3c927e552e33e1476be4ba488efa (patch)
treeb5a7e329aa7ef48cacc76e092370dfc51b92d553 /ONAP-PAP-REST/src
parent214338aa61978daf5c169f02c4c0e56527a3f90d (diff)
parent882850a0f5a147c45749facf2e78bccafce1760d (diff)
Merge "OOF Policy Config File Creation Issue"v1.2.0
Diffstat (limited to 'ONAP-PAP-REST/src')
-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);