X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.graph%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fquery%2FUriUtils.java;h=ef22553244d78de555f5ee2a2ed1d3cc809c1eec;hb=b123fe92f27f72b9132ec52c9494fb8d8715d2ed;hp=9c8f7d655f02935f48dde080eaefcb593f40cdeb;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.graph/src/org/simantics/graph/query/UriUtils.java b/bundles/org.simantics.graph/src/org/simantics/graph/query/UriUtils.java index 9c8f7d655..ef2255324 100644 --- a/bundles/org.simantics.graph/src/org/simantics/graph/query/UriUtils.java +++ b/bundles/org.simantics.graph/src/org/simantics/graph/query/UriUtils.java @@ -1,30 +1,30 @@ -package org.simantics.graph.query; - - -public class UriUtils { - - public static Path uriToPath(String uri) { - String[] segments; - Path cur; - if(uri.startsWith("http:/")) { - if(uri.length() == 6) - return Paths.Root; - segments = uri.substring(7).split("/"); - cur = Paths.Root; - } - else { - int p = uri.indexOf('/'); - if(p == -1) - return new PathRoot(uri); - else { - segments = uri.substring(p+1).split("/"); - cur = new PathRoot(uri.substring(0, p)); - } - } - - for(String segment : segments) - cur = new PathChild(segment, cur); - return cur; - } - -} +package org.simantics.graph.query; + + +public class UriUtils { + + public static Path uriToPath(String uri) { + String[] segments; + Path cur; + if(uri.startsWith("http:/")) { + if(uri.length() == 6) + return Paths.Root; + segments = uri.substring(7).split("/"); + cur = Paths.Root; + } + else { + int p = uri.indexOf('/'); + if(p == -1) + return new PathRoot(uri); + else { + segments = uri.substring(p+1).split("/"); + cur = new PathRoot(uri.substring(0, p)); + } + } + + for(String segment : segments) + cur = new PathChild(segment, cur); + return cur; + } + +}