aboutsummaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java
diff options
context:
space:
mode:
authorRavindra Bakkamanthala <rb7147@att.com>2017-06-05 22:42:02 -0400
committerRavindra Bakkamanthala <rb7147@att.com>2017-06-07 14:47:34 -0400
commitfc5c07705edc4dcb7083b39116a43844bb6a1490 (patch)
treeab5c7258197fc776fef8106413704a5f0a829160 /POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java
parentd9007d680d19734d5dc106479784c420236cca4b (diff)
Fixed the Policy API issues and Bugfixes
Change-Id: I6e8b54442421b6ebd0ff88426fc6e5f3a36b0690 Signed-off-by: Ravindra Bakkamanthala <rb7147@att.com>
Diffstat (limited to 'POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java')
-rw-r--r--POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java
index 68dff19bd..8258b8bed 100644
--- a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java
+++ b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java
@@ -20,7 +20,12 @@
package org.openecomp.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;
@@ -355,11 +360,25 @@ public class CreateBRMSParamController extends RestrictedBaseController {
private 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 : data.split("\n")) {
+ for (String line : Files.readAllLines(Paths.get(file.toString()))) {
if (line.isEmpty() || line.startsWith("//")) {
continue;
}