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 ResolveContext<Object> resolveContext, @NotNull org.apache.sling.resourceresolver.impl.ResourceAccessSecurityTracker tracker) Constructor -
Method Summary
Modifier and TypeMethodDescription<AdapterType>
AdapterTypevoidcommit()booleanvoidfindResources(String query, String language) getAttribute(String name) voidgetAttributeNames(Set<String> attributeNames) Get the parent resource@NotNull ResolveContext<Object>Get the resolve context.String[]booleanbooleanisLive()Check if the provider is livelistChildren(Resource parent) booleanbooleanorderBefore(@NotNull 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 ResolveContext<Object> resolveContext, @NotNull @NotNull org.apache.sling.resourceresolver.impl.ResourceAccessSecurityTracker tracker) Constructor- Parameters:
providerHandler- the providerHandleruseRAS- useRASresolveContext- resolveContexttracker- tracker
-
-
Method Details
-
getResolveContext
Get the resolve context.- Returns:
- The resolve context
-
refresh
public void refresh()- See Also:
-
isLive
public boolean isLive()Check if the provider is live- Returns:
trueIf live- See Also:
-
getParent
Get the parent resource- Parameters:
child- The child- Returns:
- The parent
- See Also:
-
getResource
- Parameters:
path- the pathparent- parentparameters- parameters- Returns:
- the resource
- See Also:
-
listChildren
- Parameters:
parent- parent- Returns:
- the iterator
- See Also:
-
getAttributeNames
- Parameters:
attributeNames- attributeNames- See Also:
-
getAttribute
- Parameters:
name- name- Returns:
- the attribute
- See Also:
-
create
public Resource create(ResourceResolver resolver, String path, Map<String, Object> properties) throws PersistenceException- Parameters:
resolver- the resolverpath- pathproperties- properties- Returns:
- the resource
- Throws:
PersistenceException- in case of problems- See Also:
-
orderBefore
public boolean orderBefore(@NotNull @NotNull Resource parent, @NotNull @NotNull String name, @Nullable @Nullable String followingSiblingName) throws PersistenceException - Parameters:
parent- parentname- namefollowingSiblingName- followingSiblingName- Returns:
- true if the order was changed, false if the order was correct already before
- Throws:
PersistenceException- in case of problems- See Also:
-
delete
- Parameters:
resource- resource- Throws:
PersistenceException- in case of problems- See Also:
-
revert
public void revert()- See Also:
-
commit
- Throws:
PersistenceException- in case of problems- See Also:
-
hasChanges
public boolean hasChanges()- Returns:
- true if there are transient changes
- See Also:
-
getSupportedLanguages
- Returns:
- array with the support query languages
- See Also:
-
findResources
- Parameters:
query- the querylanguage- the language of the query- Returns:
- an iterator covering the found resources
- See Also:
-
queryResources
- Parameters:
query- the querylanguage- the language of the query- Returns:
- a map with the result
- See Also:
-
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:
-
copy
- Parameters:
srcAbsPath- the absolute source pathdestAbsPath- the absolute target path- Returns:
- true if the copy succeeded, false otherwise
- Throws:
PersistenceException- in case of problems- See Also:
-
move
- Parameters:
srcAbsPath- the absolute source pathdestAbsPath- the absolute target path- Returns:
- true if the move succeeded, false otherwise
- Throws:
PersistenceException- in case of problems- See Also:
-
toString
-