diff options
author | 2019-03-25 13:46:06 +0000 | |
---|---|---|
committer | 2019-03-25 13:46:06 +0000 | |
commit | d34c02725d33d4b9cfa3ac70742b47be65b31066 (patch) | |
tree | ce03c44c382357155aac9c1c0e6f96ccddc5d47a /csarvalidation/src/main/java/org/onap/cvc/csar/cc/VTPValidateCSARBase.java | |
parent | 873fbb49dcd3092d2591a4eca13470713ca443ea (diff) | |
parent | 5873269dcf426377a037e28a0b16bd18af582a7e (diff) |
Merge "PNF TC R293901"
Diffstat (limited to 'csarvalidation/src/main/java/org/onap/cvc/csar/cc/VTPValidateCSARBase.java')
-rw-r--r-- | csarvalidation/src/main/java/org/onap/cvc/csar/cc/VTPValidateCSARBase.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/VTPValidateCSARBase.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/VTPValidateCSARBase.java index d07884d..d879ff3 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/VTPValidateCSARBase.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/VTPValidateCSARBase.java @@ -42,14 +42,14 @@ public abstract class VTPValidateCSARBase extends OnapCommand { String path = (String) getParametersMap().get("csar").getValue(); //execute - try { - CSARArchive csar = new CSARArchive(); + try (CSARArchive csar = this.createArchiveInstance()){ csar.init(path); csar.parse(); + errors.addAll(csar.getErrors()); + this.validateCSAR(csar); - csar.cleanup(); } catch (Exception e) { LOG.error(this.getVnfReqsNo() + ": Failed to validate CSAR" , e); throw new OnapCommandExecutionFailed(e.getMessage()); @@ -65,4 +65,8 @@ public abstract class VTPValidateCSARBase extends OnapCommand { this.getResult().setOutput(this.errors); } + + protected CSARArchive createArchiveInstance(){ + return new CSARArchive(); + } } |