Class ResourceProviderHandler
java.lang.Object
org.apache.sling.resourceresolver.impl.providers.ResourceProviderHandler
- All Implemented Interfaces:
Comparable<ResourceProviderHandler>,Pathable
public class ResourceProviderHandler
extends Object
implements Comparable<ResourceProviderHandler>, Pathable
Holder for a resource provider service.
-
Constructor Summary
ConstructorsConstructorDescriptionResourceProviderHandler(ResourceProviderInfo info, org.apache.sling.spi.resource.provider.ResourceProvider<Object> provider) Create a new handler -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Start the resource provderintvoidDeactivate this handler.getInfo()Get the resource provider infogetPath()Get the path where the provider is mounted.Get the provider context.org.apache.sling.spi.resource.provider.ResourceProvider<Object>Get the resource provider.booleanisUsed()Check whether this provider has been used.toString()voidupdate()Update the providerorg.apache.sling.spi.resource.provider.ResourceProvider<Object>Get the resource provider and mark it as used.
-
Constructor Details
-
ResourceProviderHandler
public ResourceProviderHandler(ResourceProviderInfo info, org.apache.sling.spi.resource.provider.ResourceProvider<Object> provider) Create a new handler- Parameters:
info- Resource provider info.provider- The resource provider
-
-
Method Details
-
getInfo
Get the resource provider info- Returns:
- The resource provider info or
nullif this handler has been deactivated.
-
activate
public void activate()Start the resource provder -
deactivate
public void deactivate()Deactivate this handler. Unget the provider service. -
getResourceProvider
Get the resource provider.- Returns:
- The resource provider or
nullif it is not active.
-
useResourceProvider
Get the resource provider and mark it as used.- Returns:
- The resource provider or
nullif it is not active.
-
isUsed
public boolean isUsed()Check whether this provider has been used.- Returns:
trueif used
-
compareTo
- Specified by:
compareToin interfaceComparable<ResourceProviderHandler>
-
getPath
Get the path where the provider is mounted. -
update
public void update()Update the provider -
getProviderContext
Get the provider context.- Returns:
- The provider context
-
toString
-