diff options
author | Wang,Frank(gw1218) <gw1218@att.com> | 2018-04-03 16:17:54 -0500 |
---|---|---|
committer | Wang,Frank(gw1218) <gw1218@att.com> | 2018-04-03 17:00:10 -0500 |
commit | ff0146fb327dbe5f27b0bd29640f3ace54006d92 (patch) | |
tree | 751832c2d010ad43b5fbda75f3060cd5c16d8f56 /POLICY-SDK-APP/src/main/java/org | |
parent | 11eb39f53842dff62e81a38ab599ddbc97cf7b73 (diff) |
Add More Validations on TOSCA Model Format
Add more validations on TOSCA MS model file name and content format
Issue-ID: POLICY-721
Change-Id: Ic3dfe1887791be1e11bca5695866a77909334536
Signed-off-by: Wang,Frank(gw1218) <gw1218@att.com>
Diffstat (limited to 'POLICY-SDK-APP/src/main/java/org')
-rw-r--r-- | POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java index 0f315a392..c4c822005 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java @@ -1177,7 +1177,17 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { fileList = listModelFiles(this.directory); }else if (yml==true){ - msMLUtils.parseTosca(this.newFile); + errorMsg = msMLUtils.parseTosca(this.newFile); + if(errorMsg != null){ + PrintWriter out = response.getWriter(); + response.setCharacterEncoding("UTF-8"); + response.setContentType("application / json"); + request.setCharacterEncoding("UTF-8"); + JSONObject j = new JSONObject(); + j.put("errorMsg", errorMsg); + out.write(j.toString()); + return; + } }else { File file = new File(this.newFile); |