Class StarResource
- java.lang.Object
-
- org.apache.sling.api.adapter.SlingAdaptable
-
- org.apache.sling.api.resource.AbstractResource
-
- org.apache.sling.api.resource.SyntheticResource
-
- org.apache.sling.resourceresolver.impl.helper.StarResource
-
- All Implemented Interfaces:
org.apache.sling.api.adapter.Adaptable,org.apache.sling.api.resource.Resource
@Adaptable(adaptableClass=org.apache.sling.api.resource.Resource.class, adapters=@Adapter(java.lang.String.class)) public class StarResource extends org.apache.sling.api.resource.SyntheticResourceUsed to provide the equivalent of an empty Node for GET requests to *.something (SLING-344)
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_RESOURCE_TYPE
-
Constructor Summary
Constructors Constructor Description StarResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <Type> TypeadaptTo(Class<Type> type)static booleanappliesTo(String path)True if a StarResource should be used for the given request, if a real Resource was not foundStringgetResourceSuperType()CallsResourceUtil.getResourceSuperType(ResourceResolver, String)method to dynamically resolve the resource super type of this star resource.static booleanisStarResource(org.apache.sling.api.resource.Resource res)Returns true if the path of the resource ends with theSLASH_STARand therefore should be considered a star resource.-
Methods inherited from class org.apache.sling.api.resource.SyntheticResource
getPath, getResourceMetadata, getResourceResolver, getResourceType, toString
-
Methods inherited from class org.apache.sling.api.resource.AbstractResource
getChild, getChildren, getName, getParent, getValueMap, hasChildren, isResourceType, listChildren
-
-
-
-
Field Detail
-
DEFAULT_RESOURCE_TYPE
public static final String DEFAULT_RESOURCE_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StarResource
public StarResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path)
-
-
Method Detail
-
appliesTo
public static boolean appliesTo(String path)
True if a StarResource should be used for the given request, if a real Resource was not found- Parameters:
path- the path- Returns:
- true if the StarResource should be used, false otherwise
-
isStarResource
public static boolean isStarResource(org.apache.sling.api.resource.Resource res)
Returns true if the path of the resource ends with theSLASH_STARand therefore should be considered a star resource.- Parameters:
res- the resource- Returns:
- true if the StarResource should be used, false otherwise
-
getResourceSuperType
public String getResourceSuperType()
CallsResourceUtil.getResourceSuperType(ResourceResolver, String)method to dynamically resolve the resource super type of this star resource.- Specified by:
getResourceSuperTypein interfaceorg.apache.sling.api.resource.Resource- Overrides:
getResourceSuperTypein classorg.apache.sling.api.resource.SyntheticResource- Returns:
- the resource supertype
-
adaptTo
public <Type> Type adaptTo(Class<Type> type)
- Specified by:
adaptToin interfaceorg.apache.sling.api.adapter.Adaptable- Overrides:
adaptToin classorg.apache.sling.api.adapter.SlingAdaptable
-
-