Adapt to Java 11
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / jcr / RepositoryBuilder.java
index 622600d3ce6ba6fe5f34198247ed850eb349e30c..86ce94bb40884b47c493c1c12e7dfa184c2980f8 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);
                        }
@@ -193,8 +200,8 @@ public class RepositoryBuilder {
                        RepositoryContext repositoryContext = RepositoryContext.create(repositoryConfig);
 
                        double duration = ((double) (System.currentTimeMillis() - begin)) / 1000;
-                       if (log.isTraceEnabled())
-                               log.trace(
+                       if (log.isDebugEnabled())
+                               log.debug(
                                                "Created Jackrabbit repository in " + duration + " s, home: " + repositoryConfig.getHomeDir());
 
                        return repositoryContext;