/** * Gets a repository by name, but only if its class is a subclass of the class passed as a parameter.<p> * Otherwise, null will be returned.<p> * * @param name the repository name * @param cls the class used to filter repositories * * @return the repository with the given name, or null */ @SuppressWarnings("unchecked") public <REPO extends I_CmsRepository> REPO getRepository(String name, Class<REPO> cls) { I_CmsRepository repo = getRepository(name); if (repo == null) { return null; } if (cls.isInstance(repo)) { return (REPO)repo; } else { return null; } }
/** * Gets the repository for a given repository id.<p> * * @param repositoryId the repository id * * @return the repository with the given id */ protected I_CmsCmisRepository getRepository(String repositoryId) { I_CmsCmisRepository result = OpenCms.getRepositoryManager().getRepository( repositoryId, I_CmsCmisRepository.class); if (result == null) { throw new CmisConnectionException("missing repository: " + repositoryId); } return result; }
m_repository = OpenCms.getRepositoryManager().getRepository(repositoryName, A_CmsRepository.class); if (m_repository == null) {
m_repository = OpenCms.getRepositoryManager().getRepository(repositoryName); if (m_repository == null) {