X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fschema%2FRelationshipSchemaValidator.java;h=e2374bef1a903f89554f671e15dc519cb1a51e14;hb=refs%2Fchanges%2F95%2F9995%2F1;hp=af20699348e5d14085939ded2d0ae4cd54794f1b;hpb=900114bf694a0b34e8de3d283b5929fed4aaf65d;p=aai%2Fgizmo.git 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); + } }