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.SyntheticResource
Used to provide the equivalent of an empty Node for GET requests to *.something (SLING-344)
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_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> Type
adaptTo(Class<Type> type)
static boolean
appliesTo(String path)
True if a StarResource should be used for the given request, if a real Resource was not foundString
getResourceSuperType()
CallsResourceUtil.getResourceSuperType(ResourceResolver, String)
method to dynamically resolve the resource super type of this star resource.static boolean
isStarResource(org.apache.sling.api.resource.Resource res)
Returns true if the path of the resource ends with theSLASH_STAR
and 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
-
isStarResource
public static boolean isStarResource(org.apache.sling.api.resource.Resource res)
Returns true if the path of the resource ends with theSLASH_STAR
and therefore should be considered a star resource.
-
getResourceSuperType
public String getResourceSuperType()
CallsResourceUtil.getResourceSuperType(ResourceResolver, String)
method to dynamically resolve the resource super type of this star resource.- Specified by:
getResourceSuperType
in interfaceorg.apache.sling.api.resource.Resource
- Overrides:
getResourceSuperType
in classorg.apache.sling.api.resource.SyntheticResource
-
adaptTo
public <Type> Type adaptTo(Class<Type> type)
- Specified by:
adaptTo
in interfaceorg.apache.sling.api.adapter.Adaptable
- Overrides:
adaptTo
in classorg.apache.sling.api.adapter.SlingAdaptable
-
-