summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'csarvalidation/src/main')
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java24
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/PnfCSARArchive.java9
2 files changed, 25 insertions, 8 deletions
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java b/csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java
index e94ff88..24cef0e 100644
--- a/csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/CSARArchive.java
@@ -384,8 +384,8 @@ public class CSARArchive {
}
public static class CSARErrorInvalidEntryValueManifestNotFound extends CSARErrorInvalidEntryValue {
- public CSARErrorInvalidEntryValueManifestNotFound(String manifest, int lineNo) {
- super(TOSCA_Metadata__TOSCA_Meta__Entry_Manifest,
+ public CSARErrorInvalidEntryValueManifestNotFound(String manifest, int lineNo, String entryManifestArgumentName) {
+ super(entryManifestArgumentName,
TOSCA_Metadata__TOSCA_Meta,
lineNo,
manifest + " does not exist",
@@ -396,8 +396,8 @@ public class CSARArchive {
}
public static class CSARErrorInvalidEntryValueLogsNotFound extends CSARErrorInvalidEntryValue {
- public CSARErrorInvalidEntryValueLogsNotFound(String logs, int lineNo) {
- super(TOSCA_Metadata__TOSCA_Meta__Entry_Change_Log,
+ public CSARErrorInvalidEntryValueLogsNotFound(String logs, int lineNo, String entryChangeLogArgumentName) {
+ super(entryChangeLogArgumentName,
TOSCA_Metadata__TOSCA_Meta,
lineNo,
logs + " does not exist",
@@ -1097,21 +1097,21 @@ public class CSARArchive {
this.toscaMeta.getEntryDefinitionYaml(),
lineNo));
}
- } else if(key.equalsIgnoreCase(TOSCA_Metadata__TOSCA_Meta__Entry_Manifest)) {
+ } else if(key.equalsIgnoreCase(getEntryManifestParamName())) {
this.toscaMeta.setEntryManifestMf(value);
this.manifestMfFile = this.tempDir.resolve(this.toscaMeta.getEntryManifestMf()).toFile();
if (!this.manifestMfFile.exists()) {
errors.add(new CSARErrorInvalidEntryValueManifestNotFound(
this.toscaMeta.getEntryManifestMf(),
- lineNo));
+ lineNo, getEntryManifestParamName()));
}
- } else if(key.equalsIgnoreCase(TOSCA_Metadata__TOSCA_Meta__Entry_Change_Log)) {
+ } else if(key.equalsIgnoreCase(getEntryChangeLogParamName())) {
this.toscaMeta.setEntryChangeLog(value);
this.changeLogTxtFile = this.tempDir.resolve(this.toscaMeta.getEntryChangeLog()).toFile();
if (!this.changeLogTxtFile.exists()) {
errors.add(new CSARErrorInvalidEntryValueLogsNotFound(
this.toscaMeta.getEntryChangeLog(),
- lineNo));
+ lineNo, getEntryChangeLogParamName()));
}
} else if(key.equalsIgnoreCase(TOSCA_Metadata__TOSCA_Meta__Entry_Tests)) {
this.toscaMeta.setEntryTest(value);
@@ -1283,6 +1283,14 @@ public class CSARArchive {
}
}
+ String getEntryManifestParamName(){
+ return TOSCA_Metadata__TOSCA_Meta__Entry_Manifest;
+ }
+
+ String getEntryChangeLogParamName(){
+ return TOSCA_Metadata__TOSCA_Meta__Entry_Change_Log;
+ }
+
public void init(String csarPath) throws IOException {
this.tempDir = Paths.get(TEMP_DIR + File.separator + System.currentTimeMillis());
this.tempDir.toFile().mkdirs();
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/PnfCSARArchive.java b/csarvalidation/src/main/java/org/onap/cvc/csar/PnfCSARArchive.java
index bb0a723..9dc966b 100644
--- a/csarvalidation/src/main/java/org/onap/cvc/csar/PnfCSARArchive.java
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/PnfCSARArchive.java
@@ -45,4 +45,13 @@ public class PnfCSARArchive extends CSARArchive {
this.getErrors().addAll(nonManoArtifactsData.getValue());
}
+ @Override
+ String getEntryManifestParamName(){
+ return "ETSI-Entry-Manifest";
+ }
+
+ @Override
+ String getEntryChangeLogParamName(){
+ return "ETSI-Entry-Change-Log";
+ }
}