summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java4
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java7
2 files changed, 8 insertions, 3 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java
index 152b78b15c..0e08be5d7a 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java
@@ -198,6 +198,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic {
private static final String CREATE_RESOURCE_VALIDATE_CAPABILITY_TYPES = "Create Resource - validateCapabilityTypesCreate";
private static final String COMPONENT_INSTANCE_WITH_NAME = "component instance with name ";
private static final String COMPONENT_INSTANCE_WITH_NAME_IN_RESOURCE = "component instance with name {} in resource {} ";
+ private static final String VALID_CHARACTERS_ARTIFACT_NAME = "'A-Z', 'a-z', '0-9', '.', '_', '-', '@' and space";
private static final LoggerSupportability loggerSupportability = LoggerSupportability.getLogger(ResourceBusinessLogic.class.getName());
private final ComponentInstanceBusinessLogic componentInstanceBusinessLogic;
private final ResourceImportManager resourceImportManager;
@@ -2148,7 +2149,8 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic {
Either<List<NonMetaArtifactInfo>, String> artifactPathAndNameList = getValidArtifactNames(csarInfo, collectedWarningMessages);
if (artifactPathAndNameList.isRight()) {
return Either.right(
- getComponentsUtils().getResponseFormatByArtifactId(ActionStatus.ARTIFACT_NAME_INVALID, artifactPathAndNameList.right().value()));
+ getComponentsUtils().getResponseFormatByArtifactId(ActionStatus.ARTIFACT_NAME_INVALID, artifactPathAndNameList.right().value(),
+ VALID_CHARACTERS_ARTIFACT_NAME));
}
EnumMap<ArtifactOperationEnum, List<NonMetaArtifactInfo>> vfCsarArtifactsToHandle = null;
if (artifactOperation.isCreateOrLink()) {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java
index 3b55e67c75..af05825545 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java
@@ -404,12 +404,15 @@ public class ComponentsUtils {
return responseFormat;
}
- public ResponseFormat getResponseFormatByArtifactId(ActionStatus actionStatus, String artifactId) {
+ public ResponseFormat getResponseFormatByArtifactId(ActionStatus actionStatus, String... params) {
ResponseFormat responseFormat;
switch (actionStatus) {
case RESOURCE_NOT_FOUND:
case ARTIFACT_NOT_FOUND:
- responseFormat = getResponseFormat(ActionStatus.ARTIFACT_NOT_FOUND, artifactId);
+ responseFormat = getResponseFormat(ActionStatus.ARTIFACT_NOT_FOUND, params);
+ break;
+ case ARTIFACT_NAME_INVALID:
+ responseFormat = getResponseFormat(ActionStatus.ARTIFACT_NAME_INVALID, params);
break;
default:
responseFormat = getResponseFormat(actionStatus);