diff options
author | 2019-05-29 13:40:50 +0200 | |
---|---|---|
committer | 2019-05-29 13:40:50 +0200 | |
commit | 2b293e3d6c9c2ff693ccebf8ee757980cf6e2499 (patch) | |
tree | ee37be08b4f69168d8c5a0813ee2098f91dfb7ef /csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR57019.java | |
parent | 92f5f94f7150472ce4af61dc0cad70389d636d95 (diff) |
Clearer message
Change-Id: I1ca7c3596e55c4b6c58d3ccb8224929e8575176d
Issue-ID: VNFSDK-412
Signed-off-by: Zebek Bogumil <bogumil.zebek@nokia.com>
Diffstat (limited to 'csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR57019.java')
-rw-r--r-- | csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR57019.java | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR57019.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR57019.java index 3dea564..dc507dd 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR57019.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR57019.java @@ -23,6 +23,7 @@ import org.onap.cvc.csar.CSARArchive; import org.onap.cvc.csar.PnfCSARError.PnfCSARErrorEntryMissing; import org.onap.cvc.csar.cc.VTPValidateCSARBase; +import java.io.File; import java.util.Objects; @OnapCommandSchema(schema = "vtp-validate-csar-r57019.yaml") @@ -30,15 +31,28 @@ public class VTPValidateCSARR57019 extends VTPValidateCSARBase { private static final int UNKNOWN_LINE_NUMBER = -1; + public static class ToscaMetaNotAvailableError extends CSARArchive.CSARErrorInvalidEntryValue { + public ToscaMetaNotAvailableError() { + super("", + "CSAR Archive", + "Unable to find TOSCA.meta file in TOSCA-metadata directory.",""); + this.setCode("0x1000"); + } + } + @Override protected void validateCSAR(CSARArchive csar) { - final CSARArchive.Manifest.Metadata metadata = csar.getManifest().getMetadata(); - final String fileName = csar.getManifestMfFile().getName(); + final CSARArchive.Manifest manifest = csar.getManifest(); + final CSARArchive.Manifest.Metadata metadata = manifest.getMetadata(); + final File manifestMfFile = csar.getManifestMfFile(); + if(manifestMfFile!=null) { + final String fileName = manifestMfFile.getName(); - validateMetadataValue(fileName, metadata.getProviderId(), "pnfd_provider"); - validateMetadataValue(fileName, metadata.getProductName(), "pnfd_name"); - validateMetadataValue(fileName, metadata.getReleaseDateTime(), "pnfd_release_date_time"); - validateMetadataValue(fileName, metadata.getPackageVersion(), "pnfd_archive_version"); + validateMetadataValue(fileName, metadata.getProviderId(), "pnfd_provider"); + validateMetadataValue(fileName, metadata.getProductName(), "pnfd_name"); + validateMetadataValue(fileName, metadata.getReleaseDateTime(), "pnfd_release_date_time"); + validateMetadataValue(fileName, metadata.getPackageVersion(), "pnfd_archive_version"); + } } |