|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.sling.fsprovider.internal.FsResourceProvider
public class FsResourceProvider
The FsResourceProvider
is a resource provider which maps
filesystem files and folders into the virtual resource tree. The provider is
implemented in terms of a component factory, that is multiple instances of
this provider may be created by creating respective configuration.
Each provider instance is configured with two properties: The location in the
resource tree where resources are provided (ResourceProvider.ROOTS
)
and the file system path from where files and folders are mapped into the
resource (PROP_PROVIDER_FILE
).
Field Summary | |
---|---|
static long |
DEFAULT_CHECKINTERVAL
|
static String |
PROP_PROVIDER_CHECKINTERVAL
The name of the configuration property providing the check interval for file changes (value is "provider.checkinterval"). |
static String |
PROP_PROVIDER_FILE
The name of the configuration property providing file system path of files and folders mapped into the resource tree (value is "provider.file"). |
Fields inherited from interface org.apache.sling.api.resource.ResourceProvider |
---|
RESOURCE_TYPE_SYNTHETIC, ROOTS, SERVICE_NAME |
Constructor Summary | |
---|---|
FsResourceProvider()
|
Method Summary | |
---|---|
protected void |
activate(org.osgi.framework.BundleContext bundleContext,
Map<?,?> props)
|
protected void |
deactivate()
|
Resource |
getResource(ResourceResolver resourceResolver,
javax.servlet.http.HttpServletRequest request,
String path)
Same as getResource(ResourceResolver, String) , i.e. |
Resource |
getResource(ResourceResolver resourceResolver,
String path)
Returns a resource wrapping a filesystem file or folder for the given path. |
Iterator<Resource> |
listChildren(Resource parent)
Returns an iterator of resources. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROP_PROVIDER_FILE
public static final String PROP_PROVIDER_CHECKINTERVAL
public static long DEFAULT_CHECKINTERVAL
Constructor Detail |
---|
public FsResourceProvider()
Method Detail |
---|
public Resource getResource(ResourceResolver resourceResolver, javax.servlet.http.HttpServletRequest request, String path)
getResource(ResourceResolver, String)
, i.e. the
request
parameter is ignored.
getResource
in interface ResourceProvider
resourceResolver
- The ResourceResolver
to which the
returned Resource
is attached.
null
If this provider does not have a resource for
the path.getResource(ResourceResolver, String)
public Resource getResource(ResourceResolver resourceResolver, String path)
path
is equal to the configured resource tree
location of this provider, the configured file system file or folder is
used for the resource. Otherwise the configured resource tree location
prefix is removed from the path and the remaining relative path is used
to access the file or folder. If no such file or folder exists, this
method returns null
.
getResource
in interface ResourceProvider
resourceResolver
- The ResourceResolver
to which the
returned Resource
is attached.
null
If this provider does not have a resource for
the path.public Iterator<Resource> listChildren(Resource parent)
listChildren
in interface ResourceProvider
parent
- The Resource
whose children are requested.
Iterator
of Resource
objects or
null
if the resource provider has no children for
the given resource.protected void activate(org.osgi.framework.BundleContext bundleContext, Map<?,?> props)
protected void deactivate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |