Class AuthenticatedResourceProvider
java.lang.Object
org.apache.sling.resourceresolver.impl.providers.stateful.AuthenticatedResourceProvider
This
AuthenticatedResourceProvider implementation keeps a resource
provider and the authentication information (through the ResolveContext).
The methods are similar to those of ResourceProvider.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticatedResourceProvider(@NotNull ResourceProviderHandler providerHandler, boolean useRAS, @NotNull org.apache.sling.spi.resource.provider.ResolveContext<Object> resolveContext, @NotNull org.apache.sling.resourceresolver.impl.ResourceAccessSecurityTracker tracker) Constructor -
Method Summary
Modifier and TypeMethodDescription<AdapterType>
AdapterTypevoidcommit()booleanorg.apache.sling.api.resource.Resourcecreate(org.apache.sling.api.resource.ResourceResolver resolver, String path, Map<String, Object> properties) voiddelete(org.apache.sling.api.resource.Resource resource) Iterator<org.apache.sling.api.resource.Resource>findResources(String query, String language) getAttribute(String name) voidgetAttributeNames(Set<String> attributeNames) org.apache.sling.api.resource.ResourcegetParent(org.apache.sling.api.resource.Resource child) Get the parent resource@NotNull org.apache.sling.spi.resource.provider.ResolveContext<Object>Get the resolve context.org.apache.sling.api.resource.ResourcegetResource(String path, org.apache.sling.api.resource.Resource parent, Map<String, String> parameters) String[]booleanbooleanisLive()Check if the provider is liveIterator<org.apache.sling.api.resource.Resource>listChildren(org.apache.sling.api.resource.Resource parent) booleanbooleanorderBefore(@NotNull org.apache.sling.api.resource.Resource parent, @NotNull String name, @Nullable String followingSiblingName) queryResources(String query, String language) voidrefresh()voidrevert()toString()
-
Field Details
-
UNAUTHENTICATED_PROVIDER
-
-
Constructor Details
-
AuthenticatedResourceProvider
public AuthenticatedResourceProvider(@NotNull @NotNull ResourceProviderHandler providerHandler, boolean useRAS, @NotNull @NotNull org.apache.sling.spi.resource.provider.ResolveContext<Object> resolveContext, @NotNull @NotNull org.apache.sling.resourceresolver.impl.ResourceAccessSecurityTracker tracker) Constructor- Parameters:
providerHandler- the providerHandleruseRAS- useRASresolveContext- resolveContexttracker- tracker
-
-
Method Details
-
getResolveContext
@NotNull public @NotNull org.apache.sling.spi.resource.provider.ResolveContext<Object> getResolveContext()Get the resolve context.- Returns:
- The resolve context
-
refresh
public void refresh()- See Also:
-
ResourceProvider.refresh(ResolveContext)
-
isLive
public boolean isLive()Check if the provider is live- Returns:
trueIf live- See Also:
-
ResourceProvider.isLive(ResolveContext)
-
getParent
public org.apache.sling.api.resource.Resource getParent(org.apache.sling.api.resource.Resource child) Get the parent resource- Parameters:
child- The child- Returns:
- The parent
- See Also:
-
ResourceProvider.getParent(ResolveContext, Resource)
-
getResource
public org.apache.sling.api.resource.Resource getResource(String path, org.apache.sling.api.resource.Resource parent, Map<String, String> parameters) - Parameters:
path- the pathparent- parentparameters- parameters- Returns:
- the resource
- See Also:
-
ResourceProvider.getResource(ResolveContext, String, ResourceContext, Resource)
-
listChildren
public Iterator<org.apache.sling.api.resource.Resource> listChildren(org.apache.sling.api.resource.Resource parent) - Parameters:
parent- parent- Returns:
- the iterator
- See Also:
-
ResourceProvider.listChildren(ResolveContext, Resource)
-
getAttributeNames
- Parameters:
attributeNames- attributeNames- See Also:
-
ResourceProvider.getAttributeNames(ResolveContext)
-
getAttribute
- Parameters:
name- name- Returns:
- the attribute
- See Also:
-
ResourceProvider.getAttribute(ResolveContext, String)
-
create
public org.apache.sling.api.resource.Resource create(org.apache.sling.api.resource.ResourceResolver resolver, String path, Map<String, Object> properties) throws org.apache.sling.api.resource.PersistenceException- Parameters:
resolver- the resolverpath- pathproperties- properties- Returns:
- the resource
- Throws:
org.apache.sling.api.resource.PersistenceException- in case of problems- See Also:
-
ResourceProvider.create(ResolveContext, String, Map)
-
orderBefore
public boolean orderBefore(@NotNull @NotNull org.apache.sling.api.resource.Resource parent, @NotNull @NotNull String name, @Nullable @Nullable String followingSiblingName) throws org.apache.sling.api.resource.PersistenceException - Parameters:
parent- parentname- namefollowingSiblingName- followingSiblingName- Returns:
- true if the order was changed, false if the order was correct already before
- Throws:
org.apache.sling.api.resource.PersistenceException- in case of problems- See Also:
-
ResourceProvider.orderBefore(ResolveContext, Resource, String, String)
-
delete
public void delete(org.apache.sling.api.resource.Resource resource) throws org.apache.sling.api.resource.PersistenceException - Parameters:
resource- resource- Throws:
org.apache.sling.api.resource.PersistenceException- in case of problems- See Also:
-
ResourceProvider.delete(ResolveContext, Resource)
-
revert
public void revert()- See Also:
-
ResourceProvider.revert(ResolveContext)
-
commit
public void commit() throws org.apache.sling.api.resource.PersistenceException- Throws:
org.apache.sling.api.resource.PersistenceException- in case of problems- See Also:
-
ResourceProvider.commit(ResolveContext)
-
hasChanges
public boolean hasChanges()- Returns:
- true if there are transient changes
- See Also:
-
ResourceProvider.hasChanges(ResolveContext)
-
getSupportedLanguages
- Returns:
- array with the support query languages
- See Also:
-
QueryLanguageProvider.getSupportedLanguages(ResolveContext)
-
findResources
public Iterator<org.apache.sling.api.resource.Resource> findResources(String query, String language) - Parameters:
query- the querylanguage- the language of the query- Returns:
- an iterator covering the found resources
- See Also:
-
QueryLanguageProvider.findResources(ResolveContext, String, String)
-
queryResources
- Parameters:
query- the querylanguage- the language of the query- Returns:
- a map with the result
- See Also:
-
QueryLanguageProvider.queryResources(ResolveContext, String, String)
-
adaptTo
- Type Parameters:
AdapterType- the adapter target- Parameters:
type- the type to convert to- Returns:
- the adapter target or {code}null{code} if the adaption failed
- See Also:
-
ResourceProvider.adaptTo(ResolveContext, Class)
-
copy
public boolean copy(String srcAbsPath, String destAbsPath) throws org.apache.sling.api.resource.PersistenceException - Parameters:
srcAbsPath- the absolute source pathdestAbsPath- the absolute target path- Returns:
- true if the copy succeeded, false otherwise
- Throws:
org.apache.sling.api.resource.PersistenceException- in case of problems- See Also:
-
ResourceProvider.copy(ResolveContext, String, String)
-
move
public boolean move(String srcAbsPath, String destAbsPath) throws org.apache.sling.api.resource.PersistenceException - Parameters:
srcAbsPath- the absolute source pathdestAbsPath- the absolute target path- Returns:
- true if the move succeeded, false otherwise
- Throws:
org.apache.sling.api.resource.PersistenceException- in case of problems- See Also:
-
ResourceProvider.move(ResolveContext, String, String)
-
toString
-