org.apache.sling.fsprovider.internal
Class FsResource

java.lang.Object
  extended by org.apache.sling.api.adapter.SlingAdaptable
      extended by org.apache.sling.api.resource.AbstractResource
          extended by org.apache.sling.fsprovider.internal.FsResource
All Implemented Interfaces:
Adaptable, Resource

public class FsResource
extends AbstractResource
implements Resource

The FsResource represents a file system file or folder as a Sling Resource.


Field Summary
 
Fields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING
 
Method Summary
<AdapterType>
AdapterType
adaptTo(Class<AdapterType> type)
          Returns an adapter for this resource.
 String getPath()
          Returns the path of this 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()).
 ResourceResolver getResourceResolver()
          Returns the resource resolver which cause this resource object to be created.
 String getResourceSuperType()
          Returns null}
 String getResourceType()
          Returns RESOURCE_TYPE_FILE if this resource wraps a file.
 
Methods inherited from class org.apache.sling.api.resource.AbstractResource
getChild, getName, getParent, isResourceType, listChildren
 
Methods inherited from class org.apache.sling.api.adapter.SlingAdaptable
setAdapterManager, unsetAdapterManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.sling.api.resource.Resource
getChild, getName, getParent, isResourceType, listChildren
 

Method Detail

getPath

public String getPath()
Returns the path of this resource

Specified by:
getPath in interface Resource

getResourceMetadata

public ResourceMetadata getResourceMetadata()
Returns the resource meta data for this resource containing the file length, last modification time and the resource path (same as getPath()).

Specified by:
getResourceMetadata in interface Resource
See Also:
ResourceMetadata

getResourceResolver

public ResourceResolver getResourceResolver()
Returns the resource resolver which cause this resource object to be created.

Specified by:
getResourceResolver in interface Resource

getResourceSuperType

public String getResourceSuperType()
Returns null}

Specified by:
getResourceSuperType in interface Resource

getResourceType

public String getResourceType()
Returns RESOURCE_TYPE_FILE if this resource wraps a file. Otherwise RESOURCE_TYPE_FOLDER is returned.

Specified by:
getResourceType in interface Resource

adaptTo

public <AdapterType> AdapterType adaptTo(Class<AdapterType> type)
Returns an adapter for this resource. This implementation supports File, InputStream and URL plus those supported by the adapter manager.

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 Node.class
Returns:
The adapter target or null if the resource cannot adapt to the requested type
See Also:
Adaptable.adaptTo(java.lang.Class)


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.