summaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src
diff options
context:
space:
mode:
authorAvi Gaffa <avi.gaffa@amdocs.com>2017-10-24 10:23:42 +0000
committerGerrit Code Review <gerrit@onap.org>2017-10-24 10:23:42 +0000
commitb0403b04e15925fc7bdd61f59e081bf11a00d0e2 (patch)
treeb10d9e38ff90e5cc32679822bf57dcb9f8407c08 /openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src
parent5d33372dc5170b8d945a59e92c2cd5b0a5314cc3 (diff)
parentfdd32ad2577756a180258f3e09081139bcda63ed (diff)
Merge "Upload"
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUploadFactory.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUploadFactory.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUploadFactory.java
index 85f92662ea..99b311e473 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUploadFactory.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/OrchestrationUploadFactory.java
@@ -3,9 +3,12 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration;
import org.openecomp.config.api.Configuration;
import org.openecomp.config.api.ConfigurationManager;
import org.openecomp.core.utilities.CommonMethods;
+import org.openecomp.sdc.common.errors.CoreException;
import org.openecomp.sdc.datatypes.configuration.ImplementationConfiguration;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.errors.OrchestrationTemplateFileExtensionErrorBuilder;
import java.util.Map;
+import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import static org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.OrchestrationUtil.ORCHESTRATION_CONFIG_NAMESPACE;
@@ -22,7 +25,14 @@ public class OrchestrationUploadFactory {
}
public static final OrchestrationTemplateFileHandler createOrchestrationTemplateFileHandler(String filePrefix) {
- ImplementationConfiguration orchestrationTemplateFileHandler = fileHanlders.get(filePrefix);
+ String fileExtension = filePrefix.toLowerCase();
+ ImplementationConfiguration orchestrationTemplateFileHandler = fileHanlders.get(fileExtension);
+
+ if(Objects.isNull(orchestrationTemplateFileHandler)){
+ throw new CoreException(new OrchestrationTemplateFileExtensionErrorBuilder
+ ().build());
+ }
+
return CommonMethods.newInstance(orchestrationTemplateFileHandler.getImplementationClass(),
OrchestrationTemplateFileHandler.class);
}