Start dealing properly with remote node
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / jcr / RepositoryBuilder.java
index 622600d3ce6ba6fe5f34198247ed850eb349e30c..d5f3a20cd5b6a0c8650d8c0dc999d5cd05fefb52 100644 (file)
@@ -101,7 +101,14 @@ public class RepositoryBuilder {
                        }
                } else {
                        try {
-                               homePath = Paths.get(new URI(homeUri)).toAbsolutePath();
+                               URI uri = new URI(homeUri);
+                               String host = uri.getHost();
+                               if (host == null || host.trim().equals("")) {
+                                       homePath = Paths.get(uri).toAbsolutePath();
+                               } else {
+                                       // TODO remote at this stage?
+                                       throw new IllegalArgumentException("Cannot manage repository path for host " + host);
+                               }
                        } catch (URISyntaxException e) {
                                throw new CmsException("Invalid repository home URI", e);
                        }