aboutsummaryrefslogtreecommitdiffstats
path: root/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-10-22 07:53:44 -0400
committerPamela Dragosh <pdragosh@research.att.com>2019-10-23 13:33:56 -0400
commit1e61676b77dd09659027b8984f050df7e8538526 (patch)
tree115053dba12b4b27a0f92de0e7648a672a66893a /ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java
parentf18fbfc026de9cf02126f57844c37abfee607394 (diff)
Consolidate PolicyRestAdapter setup
Put common code into PolicyEngineUtils that the controllers use to populate the PolicyRestController. Also some more sonar cleanup and formatting of XML files. Shortened 120 line characters. Removed some trailing spaces from comments. Fixed up one JUnit. Licenses. Issue-ID: POLICY-2133 Change-Id: Id7d8ac3ab60331535f048ec0f26aeb17a099414e Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java')
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java
index 103928cbc..9b8854ff8 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java
@@ -22,6 +22,7 @@
package org.onap.policy.pap.xacml.rest.components;
import com.google.gson.Gson;
+
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
@@ -36,6 +37,7 @@ import java.util.List;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
+
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.onap.policy.common.logging.eelf.MessageCodes;
@@ -55,7 +57,6 @@ public class CreateNewMicroServiceModel {
private MicroServiceModels newModel = null;
private HashMap<String, MSAttributeObject> classMap = new HashMap<>();
-
private MSModelUtils utils = new MSModelUtils(XACMLPapServlet.getMsOnapName(), XACMLPapServlet.getMsPolicyName());
public CreateNewMicroServiceModel(String fileName, String serviceName, String string, String version) {
@@ -145,7 +146,6 @@ public class CreateNewMicroServiceModel {
try {
-
utils.parseTosca(fileName);
MSAttributeObject msAttributes = new MSAttributeObject();
@@ -269,7 +269,6 @@ public class CreateNewMicroServiceModel {
}
mainClass = classMap.get(this.newModel.getModelName());
-
if (".yml".equalsIgnoreCase(type)) {
newModel.setDependency("[]");