public final class FsResourceProvider extends org.apache.sling.spi.resource.provider.ResourceProvider<Object>
FsResourceProvider is a resource provider which maps
file system 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 (provider.root) and the file system path from where files and folders are mapped into the resource (provider.file).
| Modifier and Type | Class and Description |
|---|---|
static interface |
FsResourceProvider.Config |
| Modifier and Type | Field and Description |
|---|---|
static String |
RESOURCE_METADATA_FILE_DIRECTORY
Resource metadata property set by
FileResource
if the underlying file reference is a directory. |
AUTH_ADMIN, AUTH_SERVICE_BUNDLE, AUTHENTICATE_LAZY, AUTHENTICATE_NO, AUTHENTICATE_REQUIRED, PROPERTY_ADAPTABLE, PROPERTY_ATTRIBUTABLE, PROPERTY_AUTHENTICATE, PROPERTY_MODIFIABLE, PROPERTY_NAME, PROPERTY_REFRESHABLE, PROPERTY_ROOT, PROPERTY_USE_RESOURCE_ACCESS_SECURITY, RESOURCE_TYPE_SYNTHETIC| Constructor and Description |
|---|
FsResourceProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(org.osgi.framework.BundleContext bundleContext,
FsResourceProvider.Config config) |
protected void |
deactivate() |
org.apache.sling.spi.resource.provider.ObservationReporter |
getObservationReporter() |
org.apache.sling.api.resource.Resource |
getResource(org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx,
String path,
org.apache.sling.spi.resource.provider.ResourceContext resourceContext,
org.apache.sling.api.resource.Resource parent)
Returns a resource wrapping a file system file or folder for the given
path.
|
Iterator<org.apache.sling.api.resource.Resource> |
listChildren(org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx,
org.apache.sling.api.resource.Resource parent)
Returns an iterator of resources.
|
public static final String RESOURCE_METADATA_FILE_DIRECTORY
FileResource
if the underlying file reference is a directory.public org.apache.sling.api.resource.Resource getResource(org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx, String path, org.apache.sling.spi.resource.provider.ResourceContext resourceContext, org.apache.sling.api.resource.Resource parent)
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 class org.apache.sling.spi.resource.provider.ResourceProvider<Object>public Iterator<org.apache.sling.api.resource.Resource> listChildren(org.apache.sling.spi.resource.provider.ResolveContext<Object> ctx, org.apache.sling.api.resource.Resource parent)
listChildren in class org.apache.sling.spi.resource.provider.ResourceProvider<Object>protected void activate(org.osgi.framework.BundleContext bundleContext,
FsResourceProvider.Config config)
protected void deactivate()
public org.apache.sling.spi.resource.provider.ObservationReporter getObservationReporter()
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.