public class MapResourceImpl extends AbstractResource implements MapResource
RESOURCE_TYPE_NON_EXISTING
Constructor and Description |
---|
MapResourceImpl(ResourceResolver resolver,
CachingResourceProvider provider,
java.lang.String resolvedPath,
java.util.Map<java.lang.String,java.lang.Object> doc,
boolean isAttachment) |
Modifier and Type | Method and Description |
---|---|
<AdapterType> |
adaptTo(java.lang.Class<AdapterType> type)
Calls into the registered
AdapterManager to adapt this object to
the desired type . |
boolean |
checkPermissions(java.lang.String permission) |
static java.lang.String |
getAclPathGivenBase(java.lang.String path,
java.lang.String providerBase) |
Resource |
getParent()
Returns the parent resource of this resource.
|
java.lang.String |
getPath()
Returns the absolute path of this resource in the resource tree.
|
ResourceMetadata |
getResourceMetadata()
Returns the meta data of this resource.
|
SocialResourceProvider |
getResourceProvider() |
ResourceResolver |
getResourceResolver()
Returns the
ResourceResolver from which this resource has been
retrieved. |
java.lang.String |
getResourceSuperType()
Returns the super type of the resource if the resource defines its
own super type.
|
java.lang.String |
getResourceType()
The resource type is meant to point to rendering/processing scripts,
editing dialogs, etc.
|
Resource |
getRootJCRNode() |
boolean |
isAttachment() |
void |
unlockMetadata()
Unlocks the metadata for this resource.
|
void |
update() |
getChild, getChildren, getName, getValueMap, hasChildren, isResourceType, listChildren
setAdapterManager, unsetAdapterManager
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChild, getChildren, getName, getValueMap, hasChildren, isResourceType, listChildren
public MapResourceImpl(ResourceResolver resolver, CachingResourceProvider provider, java.lang.String resolvedPath, java.util.Map<java.lang.String,java.lang.Object> doc, boolean isAttachment)
public Resource getParent()
This method is implemented calling the ResourceResolver.getParent(Resource)
method.
getParent
in interface Resource
getParent
in class AbstractResource
null
.ResourceResolver.getParent(Resource)
public java.lang.String getPath()
public java.lang.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.RESOURCE_TYPE_NON_EXISTING
.
getResourceType
in interface Resource
public java.lang.String getResourceSuperType()
null
is returned.
A resource might return a resource super type to overwrite the
resource type hierarchy.
If a client is interested in the effective resource super type
of a resource, it should call ResourceResolver.getParentResourceType(Resource)
.getResourceSuperType
in interface Resource
null
.public 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.getResourceMetadata
in interface Resource
ResourceMetadata
public ResourceResolver getResourceResolver()
ResourceResolver
from which this resource has been
retrieved.getResourceResolver
in interface Resource
public SocialResourceProvider getResourceProvider()
getResourceProvider
in interface SocialResource
public <AdapterType> AdapterType adaptTo(java.lang.Class<AdapterType> type)
AdapterManager
to adapt this object to
the desired type
.
This method implements a cache of adapters to improve performance. That is repeated calls to this method with the same class will result in the same object to be returned.
adaptTo
in interface Adaptable
adaptTo
in class SlingAdaptable
AdapterType
- The generic type to which this resource is adapted
totype
- The Class object of the target type, such as
javax.jcr.Node.class
or
java.io.File.class
null
if the resource cannot
adapt to the requested typepublic void update()
public Resource getRootJCRNode()
getRootJCRNode
in interface SocialResource
public boolean isAttachment()
isAttachment
in interface MapResource
public void unlockMetadata()
unlockMetadata
in interface MapResource
public static java.lang.String getAclPathGivenBase(java.lang.String path, java.lang.String providerBase)
public boolean checkPermissions(java.lang.String permission)
checkPermissions
in interface SocialResource
Copyright © 2010 - 2020 Adobe. All Rights Reserved