当前位置: 首页>>代码示例>>Java>>正文


Java Resource.listChildren方法代码示例

本文整理汇总了Java中org.apache.sling.api.resource.Resource.listChildren方法的典型用法代码示例。如果您正苦于以下问题:Java Resource.listChildren方法的具体用法?Java Resource.listChildren怎么用?Java Resource.listChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.sling.api.resource.Resource的用法示例。


在下文中一共展示了Resource.listChildren方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listChildren

import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
@Override
public Iterator<Resource> listChildren(Resource parent) {
	return parent.listChildren();
}
 
开发者ID:apache,项目名称:sling-org-apache-sling-query,代码行数:5,代码来源:ResourceTreeProvider.java

示例2: createCategory

import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
public PatternCategoryModel createCategory(Resource resource, String patternsPath, String patternId, PatternCategoryModel parentCategory) throws IOException {
    if (isFolder(resource)) {
        final List<PatternCategoryModel> subCategories = Lists.newArrayList();
        final List<PatternModel> patterns = Lists.newArrayList();
        final PatternCategoryModel currentCategory = new PatternCategoryModel(resource, patternsPath, subCategories, patterns, parentCategory);
        final Iterator<Resource> childResources = resource.listChildren();
        while (childResources.hasNext()) {
            updateSubCategoriesAndPatterns(childResources.next(), subCategories, patterns, currentCategory, patternsPath, patternId);
        }
        return currentCategory;
    }
    return null;
}
 
开发者ID:deepthinkit,项目名称:patternlab-for-sling,代码行数:14,代码来源:PatternPatternCategoryFactoryImpl.java

示例3: retrieveJsonDataFilesInFolder

import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
private List<String> retrieveJsonDataFilesInFolder(Resource filesParentResource, String name) {
    final List<String> patternJsonDataFiles = Lists.newArrayList();
    final Iterator<Resource> children = filesParentResource.listChildren();
    while (children.hasNext()) {
        final Resource childResource = children.next();
        final String childResourceName = childResource.getName();
        if (StringUtils.startsWith(childResourceName, name) && StringUtils.endsWith(childResourceName, PatternLabConstants.DATA_EXT)) {
            patternJsonDataFiles.add(childResourceName);
        }
    }
    return patternJsonDataFiles;
}
 
开发者ID:deepthinkit,项目名称:patternlab-for-sling,代码行数:13,代码来源:PatternPatternCategoryFactoryImpl.java

示例4: constructCategories

import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
private void constructCategories(Resource pageContentResource) throws IOException {
    categories = Lists.newArrayList();
    final ResourceResolver resourceResolver = pageContentResource.getResourceResolver();
    final Resource patternsPathResource = resourceResolver.getResource(patternsPath);
    final Iterator<Resource> appsIterator = patternsPathResource.listChildren();
    while (appsIterator.hasNext()) {
        final PatternCategoryModel category = patternCategoryFactory.createCategory(appsIterator.next(), patternsPath, patternId);
        if (category != null && category.isValid()) {
            categories.add(category);
        }
    }
}
 
开发者ID:deepthinkit,项目名称:patternlab-for-sling,代码行数:13,代码来源:PatternLabPageModel.java


注:本文中的org.apache.sling.api.resource.Resource.listChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。