Class ContentFileResource
java.lang.Object
org.apache.sling.api.adapter.SlingAdaptable
org.apache.sling.api.resource.AbstractResource
org.apache.sling.fsprovider.internal.mapper.ContentFileResource
Represents a JSON File with resource content.
-
Field Summary
Fields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING
-
Method Summary
Modifier and TypeMethodDescription<AdapterType>
AdapterTypeCalls into the registeredAdapterManager
to adapt this object to the desiredtype
.@NotNull String
getPath()
Returns the absolute path of this resource in the resource tree.@NotNull ResourceMetadata
Returns the meta data of this resource.@NotNull ResourceResolver
Returns theResourceResolver
from which this resource has been retrieved.Returns the super type of the resource if the resource defines its own super type.@NotNull String
The resource type is meant to point to rendering/processing scripts, editing dialogs, etc.toString()
Methods inherited from class org.apache.sling.api.resource.AbstractResource
getChild, getChildren, getName, getParent, getValueMap, hasChildren, isResourceType, listChildren
Methods inherited from class org.apache.sling.api.adapter.SlingAdaptable
setAdapterManager, unsetAdapterManager
-
Method Details
-
getPath
Description copied from interface:Resource
Returns the absolute path of this resource in the resource tree.- Returns:
- The resource path
-
getResourceMetadata
Description copied from interface:Resource
Returns the meta data of this resource. The concrete data contained in theResourceMetadata
object returned is implementation specific except for theResourceMetadata.RESOLUTION_PATH
property which is required to be set to the part of the request URI used to resolve the resource.- Returns:
- The resource meta data
- See Also:
-
getResourceResolver
Description copied from interface:Resource
Returns theResourceResolver
from which this resource has been retrieved.- Returns:
- The resource resolver
-
getResourceSuperType
Description copied from interface:Resource
Returns the super type of the resource if the resource defines its own super type. Otherwisenull
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 callResourceResolver.getParentResourceType(Resource)
.- Returns:
- The super type of the resource or
null
.
-
getResourceType
Description copied from interface:Resource
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 theResourceResolver
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
.- Returns:
- The resource type
-
adaptTo
Description copied from class:SlingAdaptable
Calls into the registeredAdapterManager
to adapt this object to the desiredtype
.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.
- Specified by:
adaptTo
in interfaceAdaptable
- Overrides:
adaptTo
in classSlingAdaptable
- Type Parameters:
AdapterType
- The generic type to which this resource is adapted to- Parameters:
type
- The Class object of the target type, such asjavax.jcr.Node.class
orjava.io.File.class
- Returns:
- The adapter target or
null
if the resource cannot adapt to the requested type
-
toString
-