summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/main/java/org
diff options
context:
space:
mode:
authorBogumil Zebek <bogumil.zebek@nokia.com>2020-05-13 10:40:11 +0000
committerGerrit Code Review <gerrit@onap.org>2020-05-13 10:40:11 +0000
commitdf3db652192248138f5d4c66cd64e8f51c410f89 (patch)
tree68fa546cdbd8065777a182dbad149a0dc8b5166a /csarvalidation/src/main/java/org
parent8ac0d45cbe411112f5267336981240b329678c1c (diff)
parent09b19ef7c96df88d8b9de9e5e803643f8fb47201 (diff)
Merge "Fix package integrity issue with non mano arifacts"
Diffstat (limited to 'csarvalidation/src/main/java/org')
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/parser/ManifestLine.java4
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/parser/NonManoArtifactsParser.java4
2 files changed, 8 insertions, 0 deletions
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/parser/ManifestLine.java b/csarvalidation/src/main/java/org/onap/cvc/csar/parser/ManifestLine.java
index 390c534..eefc771 100644
--- a/csarvalidation/src/main/java/org/onap/cvc/csar/parser/ManifestLine.java
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/parser/ManifestLine.java
@@ -54,4 +54,8 @@ public class ManifestLine {
return line.trim().isEmpty();
}
+ boolean contains(String word) {
+ return line.contains(word);
+ }
+
}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/parser/NonManoArtifactsParser.java b/csarvalidation/src/main/java/org/onap/cvc/csar/parser/NonManoArtifactsParser.java
index d27ef68..22e8978 100644
--- a/csarvalidation/src/main/java/org/onap/cvc/csar/parser/NonManoArtifactsParser.java
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/parser/NonManoArtifactsParser.java
@@ -26,10 +26,12 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
+import static org.onap.cvc.csar.parser.ManifestConsts.BEGIN_CMS_SECTION;
import static org.onap.cvc.csar.parser.ManifestConsts.NON_MANO_ARTIFACT_SETS_TAG_SECTION;
public class NonManoArtifactsParser {
+
public Optional<Pair<Map<String, Map<String, List<String>>>, List<CSARArchive.CSARError>>> parse(List<String> lines) {
Map<String, Map<String, List<String>>> nonManoArtifacts = new HashMap<>();
List<CSARArchive.CSARError> errors = new ArrayList<>();
@@ -41,6 +43,8 @@ public class NonManoArtifactsParser {
ManifestLine manifestLine = ManifestLine.of(line);
if (manifestLine.startsWith(NON_MANO_ARTIFACT_SETS_TAG_SECTION)) {
isNonManoArtifactsSectionAvailable = true;
+ } else if (manifestLine.contains(BEGIN_CMS_SECTION)) {
+ break;
} else if (isNonManoArtifactsSectionAvailable) {
Pair<String, String> data = manifestLine.parse();