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
FieldsFields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING -
Constructor Summary
ConstructorsConstructorDescriptionStarResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path) -
Method Summary
Modifier and TypeMethodDescription<Type> Typestatic booleanTrue if a StarResource should be used for the given request, if a real Resource was not foundCallsResourceUtil.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, toStringMethods inherited from class org.apache.sling.api.resource.AbstractResource
getChild, getChildren, getName, getParent, getValueMap, hasChildren, isResourceType, listChildrenMethods inherited from class org.apache.sling.api.adapter.SlingAdaptable
setAdapterManager, unsetAdapterManager
-
Field Details
-
DEFAULT_RESOURCE_TYPE
- See Also:
-
-
Constructor Details
-
StarResource
-
-
Method Details
-
appliesTo
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
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
- Specified by:
adaptToin interfaceorg.apache.sling.api.adapter.Adaptable- Overrides:
adaptToin classorg.apache.sling.api.adapter.SlingAdaptable
-