|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Resource
Resources are pieces of content on which Sling acts
The Resource
is also an Adaptable
to get adapters to
other types. A JCR based resource might support adapting to the JCR Node on
which the resource is based.
Implementor's Note: It is recommended to not implement this interface
directly. Rather consider either extending from AbstractResource
or
ResourceWrapper
. This will make sure your implementation will not be
suffering from missing method problems should the Sling Resource API be
extended in the future.
Field Summary | |
---|---|
static String |
RESOURCE_TYPE_NON_EXISTING
The special resource type for resource instances representing nonexisting resources (value is "sling:nonexisting"). |
Method Summary | |
---|---|
Resource |
getChild(String relPath)
Returns the child at the given relative path of this resource or null if no such child exists. |
String |
getName()
Returns the name of this resource. |
Resource |
getParent()
Returns the parent resource or null if this resource
represents the root of the resource tree. |
String |
getPath()
Returns the absolute path of this resource in the resource tree. |
ResourceMetadata |
getResourceMetadata()
Returns the metadata of this resource. |
ResourceResolver |
getResourceResolver()
Returns the ResourceResolver from which this resource has been
retrieved. |
String |
getResourceSuperType()
Returns the super type of the type of the resource or null
if the getResourceType() has no supertype. |
String |
getResourceType()
The resource type is meant to point to rendering/processing scripts, editing dialogs, etc. |
boolean |
isResourceType(String resourceType)
Returns true if the resource type or any of the resource's
super type(s) equals the given resource type. |
Iterator<Resource> |
listChildren()
Returns an iterator of the direct children of this resource. |
Methods inherited from interface org.apache.sling.api.adapter.Adaptable |
---|
adaptTo |
Field Detail |
---|
static final String RESOURCE_TYPE_NON_EXISTING
ResourceResolver
instances to mark a resource which could not
actually be resolved.
getResourceType()
,
ResourceUtil.isNonExistingResource(Resource)
,
ResourceResolver.resolve(javax.servlet.http.HttpServletRequest,
String)
,
Constant Field ValuesMethod Detail |
---|
String getPath()
String getName()
path
.
Resource getParent()
null
if this resource
represents the root of the resource tree.
Iterator<Resource> listChildren()
This method is a convenience and returns exactly the same resources as
calling getResourceResolver().listChildren(resource)
.
ResourceResolver.listChildren(Resource)
Resource getChild(String relPath)
null
if no such child exists.
This method is a convenience and returns exactly the same resources as
calling getResourceResolver().getResource(resource, relPath)
.
ResourceResolver.getResource(Resource, String)
String getResourceType()
ResourceResolver
is free to set this to any suitable value such
as the primary node type of the JCR node from which the resource is
created.
If the resource instance represents a resource which is not actually
existing, this method returns RESOURCE_TYPE_NON_EXISTING
.
String getResourceSuperType()
null
if the getResourceType()
has no supertype.
boolean isResourceType(String resourceType)
true
if the resource type or any of the resource's
super type(s) equals the given resource type.
resourceType
- The resource type to check this resource against.
true
if the resource type or any of the resource's
super type(s) equals the given resource type. false
is also returned if resourceType
is
null
.ResourceMetadata getResourceMetadata()
ResourceMetadata
object returned is implementation specific
except for the ResourceMetadata.RESOLUTION_PATH
property which is
required to be set to the part of the request URI used to resolve the
resource.
ResourceMetadata
ResourceResolver getResourceResolver()
ResourceResolver
from which this resource has been
retrieved.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |