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


Java Resource.getPath方法代码示例

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


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

示例1: PatternModel

import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
public PatternModel(Resource resource, String patternsPath, String patternId, String jsonDataFile, String templateName, ResourceResolver resourceResolver) throws IOException {
    this.id = PatternLabUtils.constructPatternId(resource.getPath(), patternsPath, templateName, jsonDataFile);
    this.name = StringUtils.lowerCase(StringUtils.isBlank(jsonDataFile) ? templateName : jsonDataFile);
    this.template = templateName;
    this.path = resource.getPath();
    this.dataPath = StringUtils.isNotBlank(jsonDataFile) ? resource.getParent().getPath() + PatternLabConstants.SLASH + jsonDataFile : StringUtils.EMPTY;
    this.displayed = StringUtils.isBlank(patternId) || StringUtils.startsWith(getId(), patternId);
    this.breadcrumb = Lists.newArrayList(new BreadcrumbItemModel(PatternLabUtils.constructPatternId(resource.getPath(), patternsPath), PatternLabUtils.getResourceTitleOrName(resource)));
    if (StringUtils.isNotBlank(jsonDataFile)) {
        this.breadcrumb.add(new BreadcrumbItemModel(PatternLabUtils.constructPatternId(resource.getPath(), patternsPath, templateName), templateName));
    }
    this.breadcrumb.add(new BreadcrumbItemModel(id, name));
    this.code = PatternLabUtils.getDataFromFile(path, resourceResolver);
    this.data = PatternLabUtils.getDataFromFile(dataPath, resourceResolver);
    this.description = constructDescription(jsonDataFile, templateName, resourceResolver);
    this.embeddedPatterns = Sets.newHashSet();
    this.includingPatterns = Sets.newHashSet();
}
 
开发者ID:deepthinkit,项目名称:patternlab-for-sling,代码行数:19,代码来源:PatternModel.java

示例2: constructPatternLabPageModel

import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
@PostConstruct
private void constructPatternLabPageModel() {
    final Resource pageContentResource = request.getResource();
    rawMode = PatternLabUtils.isRawSelectorPresent(request);
    patternId = PatternLabUtils.getPatternIdFromSelector(request);
    patternCategoryFactory = new PatternPatternCategoryFactoryImpl(request.getResourceResolver());
    currentPagePath = pageContentResource.getPath();

    try {
        constructCategories(pageContentResource);
        constructSearchPatternResults();
        constructPatternsReferences();

    } catch (IOException e) {
        LOGGER.error("Error during constructing Pattern Lab page:", e);
    }

}
 
开发者ID:deepthinkit,项目名称:patternlab-for-sling,代码行数:19,代码来源:PatternLabPageModel.java

示例3: findContainingComponent

import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
/**
 * Takes resource and returns component
 *
 * @param resource The resource to fetch the component from
 * @return null or component
 */
public static Component findContainingComponent(final Resource resource) {
    ResourceResolver resourceResolver = resource.getResourceResolver();
    ComponentManager componentManager = resourceResolver.adaptTo(ComponentManager.class);
    Resource componentResource = findParentAs(resource, NT_COMPONENT);
    if (componentResource != null) {
        String componentPath = componentResource.getPath();
        if (StringUtils.isNotBlank(componentPath)) {
            return componentManager.getComponent(componentPath);
        }
    }
    return null;
}
 
开发者ID:DantaFramework,项目名称:AEM,代码行数:19,代码来源:ResourceUtils.java

示例4: getSrc

import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
@Deprecated
public static String getSrc(Resource imageResource) {
    return imageResource.getPath() + IMG_EXT + PNG_EXT;
}
 
开发者ID:DantaFramework,项目名称:AEM,代码行数:5,代码来源:ImageUtils.java

示例5: getTransformedImagePath

import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
@Deprecated
public static String getTransformedImagePath(Resource resource, String renditionName) {
    return resource.getPath() + TRANSFORM_SELECTOR + "/" + renditionName + "/" + IMAGE + JPG_EXT;
}
 
开发者ID:DantaFramework,项目名称:AEM,代码行数:5,代码来源:ImageUtils.java


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