Class FileResource
- java.lang.Object
-
- org.apache.sling.api.adapter.SlingAdaptable
-
- org.apache.sling.api.resource.AbstractResource
-
- org.apache.sling.fsprovider.internal.mapper.FileResource
-
- All Implemented Interfaces:
org.apache.sling.api.adapter.Adaptable,org.apache.sling.api.resource.Resource
@Adaptable(adaptableClass=org.apache.sling.api.resource.Resource.class,adapters={@Adapter({java.io.File.class,java.net.URL.class}),@Adapter(condition="If the resource is an FsResource and is a readable file.",value=java.io.InputStream.class)}) public final class FileResource extends org.apache.sling.api.resource.AbstractResourceTheFsResourcerepresents a file system file or folder as a Sling Resource.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <AdapterType>
AdapterTypeadaptTo(@NotNull Class<AdapterType> type)Returns an adapter for this resource.@NotNull StringgetPath()Returns the path of this resource@NotNull org.apache.sling.api.resource.ResourceMetadatagetResourceMetadata()Returns the resource meta data for this resource containing the file length, last modification time and the resource path (same asgetPath()).@NotNull org.apache.sling.api.resource.ResourceResolvergetResourceResolver()Returns the resource resolver which cause this resource object to be created.StringgetResourceSuperType()@NotNull StringgetResourceType()org.apache.sling.api.resource.ValueMapgetValueMap()StringtoString()-
Methods inherited from class org.apache.sling.api.resource.AbstractResource
getChild, getChildren, getName, getParent, hasChildren, isResourceType, listChildren
-
-
-
-
Method Detail
-
getPath
@NotNull public @NotNull String getPath()
Returns the path of this resource
-
getResourceMetadata
@NotNull public @NotNull org.apache.sling.api.resource.ResourceMetadata getResourceMetadata()
Returns the resource meta data for this resource containing the file length, last modification time and the resource path (same asgetPath()).
-
getResourceResolver
@NotNull public @NotNull org.apache.sling.api.resource.ResourceResolver getResourceResolver()
Returns the resource resolver which cause this resource object to be created.
-
getResourceSuperType
public String getResourceSuperType()
-
getResourceType
@NotNull public @NotNull String getResourceType()
-
adaptTo
@Nullable public <AdapterType> AdapterType adaptTo(@NotNull @NotNull Class<AdapterType> type)Returns an adapter for this resource. This implementation supportsFile,InputStreamandURLplus those supported by the adapter manager.- Specified by:
adaptToin interfaceorg.apache.sling.api.adapter.Adaptable- Overrides:
adaptToin classorg.apache.sling.api.adapter.SlingAdaptable
-
getValueMap
public org.apache.sling.api.resource.ValueMap getValueMap()
- Specified by:
getValueMapin interfaceorg.apache.sling.api.resource.Resource- Overrides:
getValueMapin classorg.apache.sling.api.resource.AbstractResource
-
-