aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/ValidatorFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/ValidatorFactory.java')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/ValidatorFactory.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/ValidatorFactory.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/ValidatorFactory.java
index 38c28f88ec..9d218190d8 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/ValidatorFactory.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/ValidatorFactory.java
@@ -23,7 +23,6 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar.validati
import static org.openecomp.sdc.tosca.csar.CSARConstants.ETSI_VERSION_2_7_1;
import java.io.IOException;
-
import org.openecomp.core.utilities.file.FileContentHandler;
import org.openecomp.sdc.vendorsoftwareproduct.services.impl.etsi.ETSIService;
import org.openecomp.sdc.vendorsoftwareproduct.services.impl.etsi.ETSIServiceImpl;
@@ -43,13 +42,15 @@ public class ValidatorFactory {
*/
public static Validator getValidator(final FileContentHandler fileContentHandler) throws IOException {
final ETSIService etsiService = new ETSIServiceImpl(null);
- if (etsiService.isSol004WithToscaMetaDirectory(fileContentHandler)) {
- if (!etsiService.getHighestCompatibleSpecificationVersion(fileContentHandler)
- .isLowerThan(ETSI_VERSION_2_7_1)){
- return new SOL004Version3MetaDirectoryValidator();
+ if (!etsiService.isSol004WithToscaMetaDirectory(fileContentHandler)) {
+ return new ONAPCsarValidator();
+ }
+ if (!etsiService.getHighestCompatibleSpecificationVersion(fileContentHandler).isLowerThan(ETSI_VERSION_2_7_1)){
+ if (etsiService.hasCnfEnhancements(fileContentHandler)) {
+ return new SOL004Version4MetaDirectoryValidator();
}
- return new SOL004MetaDirectoryValidator();
+ return new SOL004Version3MetaDirectoryValidator();
}
- return new ONAPCsarValidator();
+ return new SOL004MetaDirectoryValidator();
}
}