aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openecomp/schema
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/openecomp/schema')
-rw-r--r--src/main/java/org/openecomp/schema/RelationshipSchemaValidator.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/openecomp/schema/RelationshipSchemaValidator.java b/src/main/java/org/openecomp/schema/RelationshipSchemaValidator.java
index af20699..e2374be 100644
--- a/src/main/java/org/openecomp/schema/RelationshipSchemaValidator.java
+++ b/src/main/java/org/openecomp/schema/RelationshipSchemaValidator.java
@@ -338,4 +338,15 @@ public class RelationshipSchemaValidator {
return modelEdgeBuilder.build();
}
+
+ public static String vertexTypeFromUri(String uri) throws CrudException {
+
+ Matcher matcher = urlPattern.matcher(uri);
+
+ if (!matcher.matches()) {
+ throw new CrudException("Invalid Source/Target Urls", Status.BAD_REQUEST);
+ }
+
+ return matcher.group(2);
+ }
}