@Adaptable(adaptableClass=org.apache.sling.api.resource.Resource.class,adapters={@Adapter(value={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.AbstractResource
FsResource represents a file system file or folder as
a Sling Resource.| Modifier and Type | Method and Description |
|---|---|
<AdapterType> |
adaptTo(@NotNull Class<AdapterType> type)
Returns an adapter for this resource.
|
@NotNull String |
getPath()
Returns the path of this resource
|
@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 as
getPath()). |
@NotNull org.apache.sling.api.resource.ResourceResolver |
getResourceResolver()
Returns the resource resolver which cause this resource object to be
created.
|
String |
getResourceSuperType() |
@NotNull String |
getResourceType() |
org.apache.sling.api.resource.ValueMap |
getValueMap() |
String |
toString() |
getChild, getChildren, getName, getParent, hasChildren, isResourceType, listChildren@NotNull public @NotNull String getPath()
@NotNull public @NotNull org.apache.sling.api.resource.ResourceMetadata getResourceMetadata()
getPath()).@NotNull public @NotNull org.apache.sling.api.resource.ResourceResolver getResourceResolver()
public String getResourceSuperType()
@NotNull public @NotNull String getResourceType()
@Nullable
public <AdapterType> AdapterType adaptTo(@NotNull
@NotNull Class<AdapterType> type)
File, InputStream and URL
plus those supported by the adapter manager.adaptTo in interface org.apache.sling.api.adapter.AdaptableadaptTo in class org.apache.sling.api.adapter.SlingAdaptablepublic org.apache.sling.api.resource.ValueMap getValueMap()
getValueMap in interface org.apache.sling.api.resource.ResourcegetValueMap in class org.apache.sling.api.resource.AbstractResourceCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.