Class ContentFileResource

All Implemented Interfaces:
Adaptable, Resource

public final class ContentFileResource extends AbstractResource
Represents a JSON File with resource content.
  • Method Details

    • getPath

      @NotNull public @NotNull String getPath()
      Description copied from interface: Resource
      Returns the absolute path of this resource in the resource tree.
      Returns:
      The resource path
    • getResourceMetadata

      @NotNull public @NotNull ResourceMetadata getResourceMetadata()
      Description copied from interface: Resource
      Returns the meta data 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.
      Returns:
      The resource meta data
      See Also:
    • getResourceResolver

      @NotNull public @NotNull ResourceResolver getResourceResolver()
      Description copied from interface: Resource
      Returns the ResourceResolver from which this resource has been retrieved.
      Returns:
      The resource resolver
    • getResourceSuperType

      public String getResourceSuperType()
      Description copied from interface: Resource
      Returns the super type of the resource if the resource defines its own super type. Otherwise 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).
      Returns:
      The super type of the resource or null.
    • getResourceType

      @NotNull public @NotNull String 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 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 Resource.RESOURCE_TYPE_NON_EXISTING.

      Returns:
      The resource type
    • adaptTo

      public <AdapterType> AdapterType adaptTo(@Nullable @Nullable Class<AdapterType> type)
      Description copied from class: SlingAdaptable
      Calls into the registered 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.

      Specified by:
      adaptTo in interface Adaptable
      Overrides:
      adaptTo in class SlingAdaptable
      Type Parameters:
      AdapterType - The generic type to which this resource is adapted to
      Parameters:
      type - The Class object of the target type, such as javax.jcr.Node.class or java.io.File.class
      Returns:
      The adapter target or null if the resource cannot adapt to the requested type
    • toString

      public String toString()
      Overrides:
      toString in class Object