/** * Returns the first ancestor folder matching the resource type.<p> * * If no folder with the requested resource type is found, null is returned.<p> * * @param resourcename the name of the resource to start (full current site relative path) * @param type the resource type of the folder to match * * @return the first ancestor folder matching the filter criteria or null if no folder was found * * @throws CmsException if something goes wrong */ public CmsFolder readAncestor(String resourcename, int type) throws CmsException { return readAncestor(resourcename, CmsResourceFilter.requireType(type)); }
/** * Returns the first ancestor folder matching the resource type.<p> * * If no folder with the requested resource type is found, null is returned.<p> * * @param resourcename the name of the resource to start (full current site relative path) * @param type the resource type of the folder to match * * @return the first ancestor folder matching the filter criteria or null if no folder was found * * @throws CmsException if something goes wrong */ @SuppressWarnings("deprecation") public CmsFolder readAncestor(String resourcename, int type) throws CmsException { return readAncestor(resourcename, CmsResourceFilter.requireType(type)); }
/** * Initialization necessary for editing a property bundle. * * @throws CmsLoaderException thrown if loading a bundle file fails. * @throws CmsException thrown if loading a bundle file fails. * @throws IOException thrown if loading a bundle file fails. */ private void initPropertyBundle() throws CmsLoaderException, CmsException, IOException { for (Locale l : m_locales) { String filePath = m_sitepath + m_basename + "_" + l.toString(); CmsResource resource = null; if (m_cms.existsResource( filePath, CmsResourceFilter.requireType( OpenCms.getResourceManager().getResourceType(BundleType.PROPERTY.toString())))) { resource = m_cms.readResource(filePath); SortedProperties props = new SortedProperties(); CmsFile file = m_cms.readFile(resource); props.load( new InputStreamReader( new ByteArrayInputStream(file.getContents()), CmsFileUtil.getEncoding(m_cms, file))); m_keyset.updateKeySet(null, props.keySet()); m_bundleFiles.put(l, resource); } } }
CmsResourceFilter filter = CmsResourceFilter.requireType(mapping.getKey()); List<CmsResource> resources = cloneCms.readResources("/", filter); String sourceSchemaPath = mapping.getKey().getConfiguration().get("schema");
CmsResourceFilter.requireType( OpenCms.getResourceManager().getResourceType( CmsFormatterConfigurationCache.TYPE_FORMATTER_CONFIG))); CmsResource config = cms.readResource( modPath + CmsADEManager.CONFIG_FILE_NAME, CmsResourceFilter.requireType( OpenCms.getResourceManager().getResourceType(CmsADEManager.MODULE_CONFIG_TYPE))); Function<String, String> substitution = Functions.identity();
files2Transform = cmsObject.readResources( resourcePath, CmsResourceFilter.requireType(fileFormat), inclSubFolder); } catch (CmsException e) {
CmsResourceFilter.requireType(CmsResourceTypeXmlPage.getStaticTypeId()))) {
CmsResourceFilter filter = CmsResourceFilter.requireType(type); List<CmsResource> resources = cms.readResources(targetModulePath, filter); replacesMessages(descKeys, resources); CmsResourceFilter f = CmsResourceFilter.requireType( CmsResourceTypeXmlContainerPage.getContainerPageTypeId()); List<CmsResource> allContainerPages = cloneCms.readResources("/", f);
CmsResourceFilter.requireType(xmlPageId))) {