Class MergingServletResourceProvider
java.lang.Object
org.apache.sling.spi.resource.provider.ResourceProvider<Object>
org.apache.sling.servlets.resolver.internal.resource.MergingServletResourceProvider
-
Field Summary
Fields inherited from class org.apache.sling.spi.resource.provider.ResourceProvider
AUTH_ADMIN, AUTH_CLONE, AUTH_SERVICE_BUNDLE, AUTHENTICATE_LAZY, AUTHENTICATE_NO, AUTHENTICATE_REQUIRED, MODE_OVERLAY, MODE_PASSTHROUGH, PROPERTY_ADAPTABLE, PROPERTY_ATTRIBUTABLE, PROPERTY_AUTHENTICATE, PROPERTY_MODE, PROPERTY_MODIFIABLE, PROPERTY_NAME, PROPERTY_REFRESHABLE, PROPERTY_ROOT, PROPERTY_USE_RESOURCE_ACCESS_SECURITY, RESOURCE_TYPE_SYNTHETIC
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Resource
getResource
(@NotNull ResolveContext<Object> resolveContext, @NotNull String s, @NotNull ResourceContext resourceContext, @Nullable Resource resource) Returns a resource from this resource provider ornull
if the resource provider cannot find it.getResource
(ResolveContext resolveContext, String path) boolean
listChildren
(ResolveContext ctx, Resource parent) Methods inherited from class org.apache.sling.spi.resource.provider.ResourceProvider
adaptTo, authenticate, commit, copy, create, delete, getAttribute, getAttributeNames, getParent, getProviderContext, getQueryLanguageProvider, hasChanges, isLive, logout, move, orderBefore, refresh, revert, start, stop, update
-
Constructor Details
-
MergingServletResourceProvider
public MergingServletResourceProvider()
-
-
Method Details
-
isRootOf
-
getResource
@Nullable public @Nullable Resource getResource(@NotNull @NotNull ResolveContext<Object> resolveContext, @NotNull @NotNull String s, @NotNull @NotNull ResourceContext resourceContext, @Nullable @Nullable Resource resource) Description copied from class:ResourceProvider
Returns a resource from this resource provider ornull
if the resource provider cannot find it. The path must have theResourceProvider.PROPERTY_ROOT
strings as its prefix. The resource provider must not return cached instances for a resource as the resource resolver will update the resource meta data of the resource at the end of the resolution process and this meta data might be different depending on the full path of resource resolution passed into the resource resolver.- Specified by:
getResource
in classResourceProvider<Object>
- Parameters:
resolveContext
- TheResolveContext
.s
- The full path of the resource.resourceContext
- Additional information for resolving the resourceresource
- Optional parent resource- Returns:
null
If this provider does not have a resource for the path.
-
getResource
-
listChildren
Description copied from class:ResourceProvider
Returns anIterator
ofResource
objects loaded from the children of the givenResource
. The returnedResource
instances are attached to the sameResourceResolver
as the givenparent
resource.This method may be called for resource providers whose root path list contains a path such that the resource path is a prefix of the list entry. This allows for the enumeration of deeply nested provided resources for which no actual parent hierarchy exists.
The returned iterator may in turn contain resources which do not actually exist but are required to traverse the resource tree. Such resources SHOULD be
SyntheticResource
objects whose resource type MUST be set toResourceProvider.RESOURCE_TYPE_SYNTHETIC
. As withResourceProvider.getResource(ResolveContext, String, ResourceContext, Resource)
the returned Resource objects must not be cached objects.- Specified by:
listChildren
in classResourceProvider<Object>
- Parameters:
ctx
- TheResolveContext
.parent
- TheResource
whose children are requested.- Returns:
- An
Iterator
ofResource
objects ornull
if the resource provider has no children for the given resource.
-