public static Repository getRepository( String repositoryName ) throws NoSuchRepositoryException {
        Repository repository = null;
        try {
            repository = repositoriesContainer.getRepository(repositoryName, Collections.unmodifiableMap(factoryParams));
        } catch (RepositoryException e) {
            throw new NoSuchRepositoryException(WebJcrI18n.cannotInitializeRepository.text(repositoryName), e);
        }

        if (repository == null) {
            throw new NoSuchRepositoryException(WebJcrI18n.repositoryNotFound.text(repositoryName));
        }
        return repository;
    }
public static Repository getRepository ( String repositoryName ) throws NoSuchRepositoryException { Repository repository = null ; try { repository = repositoriesContainer . getRepository ( repositoryName , Collections . unmodifiableMap ( factoryParams ) ) ; } catch ( RepositoryException e ) { throw new NoSuchRepositoryException ( WebJcrI18n . cannotInitializeRepository . text ( repositoryName ) , e ) ; } if ( repository == null ) { throw new NoSuchRepositoryException ( WebJcrI18n . repositoryNotFound . text ( repositoryName ) ) ; } return repository ; }
Returns the {@link Repository} instance with the given name.
@param repositoryName a {@code non-null} string
@return a {@link Repository} instance, never {@code null}
@throws NoSuchRepositoryException if no repository with the given name exists.