diff --git a/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrRepositoryFactory.java b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrRepositoryFactory.java index 4c3228d..8568452 100644 --- a/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrRepositoryFactory.java +++ b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrRepositoryFactory.java @@ -153,9 +153,12 @@ public class JcrRepositoryFactory implements RepositoryFactory { Repositories repositories = repositoriesFor(url, parameters); if (repositories == null) return null; - String repositoryName = repositoryNameFor(repositories, url); - if (repositoryName == null) return null; + String repositoryName = (String)parameters.get(REPOSITORY_NAME_PARAM); + repositoryName = repositoryName == null ? repositoryNameFor(repositories, url) : repositoryName; + if (repositoryName == null) { + return null; + } else { try { LOG.debug("Trying to access repository: " + repositoryName); return repositories.getRepository(repositoryName); @@ -164,6 +167,7 @@ public class JcrRepositoryFactory implements RepositoryFactory { return null; } } + } /** * Returns a {@link JcrEngine} for the configuration in the given file.