org.apache.sling.api.resource
Interface Resource

All Superinterfaces:
Adaptable
All Known Implementing Classes:
AuthorizableResource, MockResource, NonExistingResource, ResourceWrapper, SyntheticResource

public interface Resource
extends Adaptable

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.


Field Summary
static java.lang.String RESOURCE_TYPE_NON_EXISTING
          The special resource type for resource instances representing nonexisting resources (value is "sling:nonexisting").
 
Method Summary
 java.lang.String getPath()
          This resource's path - for now that could be a JCR path.
 ResourceMetadata getResourceMetadata()
          Returns the metadata of this resource.
 ResourceResolver getResourceResolver()
          Returns the ResourceResolver from which this resource has been retrieved.
 java.lang.String getResourceSuperType()
          Returns the super type of the type of the resource or null if the getResourceType() has no supertype.
 java.lang.String getResourceType()
          The resource type is meant to point to rendering/processing scripts, editing dialogs, etc.
 
Methods inherited from interface org.apache.sling.api.adapter.Adaptable
adaptTo
 

Field Detail

RESOURCE_TYPE_NON_EXISTING

static final java.lang.String RESOURCE_TYPE_NON_EXISTING
The special resource type for resource instances representing nonexisting resources (value is "sling:nonexisting"). This resource type is used by ResourceResolver instances to mark a resource which could not actually be resolved.

See Also:
getResourceType(), ResourceResolver.resolve(javax.servlet.http.HttpServletRequest, String), Constant Field Values
Method Detail

getPath

java.lang.String getPath()
This resource's path - for now that could be a JCR path. It's also possible to have an URI for other data sources.


getResourceType

java.lang.String getResourceType()
The resource type is meant to point to rendering/processing scripts, editing dialogs, etc. It is usually a path in the repository, where scripts and other tools definitions are found, but the 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 the RESOURCE_TYPE_NON_EXISTING.


getResourceSuperType

java.lang.String getResourceSuperType()
Returns the super type of the type of the resource or null if the getResourceType() has no supertype.


getResourceMetadata

ResourceMetadata getResourceMetadata()
Returns the metadata of this resource. The concrete data contained in the 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.

See Also:
ResourceMetadata

getResourceResolver

ResourceResolver getResourceResolver()
Returns the ResourceResolver from which this resource has been retrieved.



Copyright © 2007-2009. All Rights Reserved.