X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FCreateBRMSParamController.java;h=9104b9822c8a67535367c29e0be95c8112b70789;hb=b51d8192e662e3ee8775235500cabb875f480e2b;hp=3107950c90a269114b2edf706625b4daeecc4b85;hpb=e938284cec3b06a7f6587b7439eb378b69c3adf1;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateBRMSParamController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateBRMSParamController.java index 3107950c9..9104b9822 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateBRMSParamController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateBRMSParamController.java @@ -20,12 +20,7 @@ package org.onap.policy.controller; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; import java.io.PrintWriter; -import java.nio.file.Files; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -367,25 +362,11 @@ public class CreateBRMSParamController extends RestrictedBaseController { public void paramUIGenerate(PolicyRestAdapter policyAdapter, PolicyEntity entity) { String data = entity.getConfigurationData().getConfigBody(); if(data != null){ - File file = new File(PolicyController.getConfigHome() +File.separator+ entity.getConfigurationData().getConfigurationName()); - if(file.exists()){ - try (BufferedReader br = new BufferedReader(new FileReader(file))) { - StringBuilder sb = new StringBuilder(); - String line = br.readLine(); - while (line != null) { - sb.append(line); - sb.append("\n"); - line = br.readLine(); - } - }catch(Exception e){ - policyLogger.error(XACMLErrorConstants.ERROR_DATA_ISSUE+ e.getMessage() + e); - } - } try { StringBuilder params = new StringBuilder(""); Boolean flag = false; Boolean comment = false; - for (String line : Files.readAllLines(Paths.get(file.toString()))) { + for (String line : data.split("\n")) { if (line.isEmpty() || line.startsWith("//")) { continue; }