本文整理汇总了Java中org.apache.sling.api.resource.Resource.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Resource.getName方法的具体用法?Java Resource.getName怎么用?Java Resource.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.sling.api.resource.Resource
的用法示例。
在下文中一共展示了Resource.getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: HTMLFileTemplateSource
import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
public HTMLFileTemplateSource(final Resource scriptResource)
throws FileNotFoundException {
if (scriptResource == null || ResourceUtil.isNonExistingResource(scriptResource))
throw new FileNotFoundException("No file with the path " + scriptResource.getName() + " was found.");
this.resource = scriptResource;
}
示例3: getName
import org.apache.sling.api.resource.Resource; //导入方法依赖的package包/类
@Override
public String getName(Resource element) {
return element.getName();
}