]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixed URI of the root resource in fail-safe import 23/623/1
authorJussi Koskela <jussi.koskela@semantum.fi>
Wed, 14 Jun 2017 12:08:03 +0000 (15:08 +0300)
committerJussi Koskela <jussi.koskela@semantum.fi>
Wed, 14 Jun 2017 12:08:03 +0000 (15:08 +0300)
URIStringUtils.splitURI returns root URI in non-standard format, so fix
it manually as a workaround. Otherwise ExternalEntities cannot be
created under the root resource.

refs #7299
Change-Id: Ie548eebba5c267617cb845df684b025b59c069f5

bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java

index 78c369f96679f9ba467b76df8bdc9f074d28e503..4894467e3d1260aa25d4239349942542000ede22 100644 (file)
@@ -339,6 +339,10 @@ public class StreamingTransferableGraphImportProcess implements TransferableGrap
                        Collections.sort(missing);
                        for(String uri : missing) {
                                String[] parts = URIStringUtils.splitURI(uri);
+                               // URIStringUtils.splitURI returns root URI in non-standard format, so fix it manually as a workaround
+                               if (parts[0].equals("http://")) {
+                                       parts[0] = "http:/";
+                               }
 
                                Resource parent = resolvedParents.get(parts[0]);
                                // TODO: proper exception message