summaryrefslogtreecommitdiffstats
path: root/common-be/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'common-be/src/main/java')
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/config/NonManoArtifactType.java3
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfiguration.java14
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/config/NonManoFolderType.java6
3 files changed, 22 insertions, 1 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoArtifactType.java b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoArtifactType.java
index 8f35b60bf8..02dcb3591b 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoArtifactType.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoArtifactType.java
@@ -37,7 +37,8 @@ public enum NonManoArtifactType {
ONAP_ANSIBLE_PLAYBOOKS("onap_ansible_playbooks"),
ONAP_SCRIPTS("onap_scripts"),
ONAP_OTHERS("onap_others"),
- ONAP_SW_INFORMATION("onap_pnf_sw_information");
+ ONAP_SW_INFORMATION("onap_pnf_sw_information"),
+ ONAP_CNF_HELM("onap_cnf_helm");
private final String type;
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfiguration.java b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfiguration.java
index 93d09a2e7a..2b2602240a 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfiguration.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoConfiguration.java
@@ -19,9 +19,13 @@
package org.openecomp.sdc.be.config;
+import java.util.Collections;
+import java.util.Map.Entry;
+import java.util.stream.Collectors;
import lombok.Data;
import java.util.Map;
+import org.apache.commons.collections.MapUtils;
/**
* Represents the non-mano configuration yaml.
@@ -39,4 +43,14 @@ public class NonManoConfiguration {
public NonManoFolderType getNonManoType(final NonManoArtifactType nonManoArtifactType) {
return nonManoKeyFolderMapping.get(nonManoArtifactType.getType());
}
+
+ public Map<String, NonManoFolderType> getNonManoKeyFolderMapping() {
+ if (MapUtils.isEmpty(nonManoKeyFolderMapping)) {
+ return Collections.emptyMap();
+ }
+
+ return nonManoKeyFolderMapping.entrySet().stream()
+ .filter(entry -> entry.getValue().isValid())
+ .collect(Collectors.toMap(Entry::getKey, Entry::getValue));
+ }
}
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoFolderType.java b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoFolderType.java
index 4d815e3f57..4ad6c31fd5 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoFolderType.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/config/NonManoFolderType.java
@@ -19,6 +19,7 @@
package org.openecomp.sdc.be.config;
import lombok.Data;
+import org.apache.commons.lang.StringUtils;
@Data
public class NonManoFolderType {
@@ -32,4 +33,9 @@ public class NonManoFolderType {
public String getPath() {
return String.format("Artifacts/%s/%s", type, location);
}
+
+
+ public boolean isValid() {
+ return StringUtils.isNotBlank(location) && StringUtils.isNotBlank(type);
+ }
}