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 ResourcegetResource(@NotNull ResolveContext<Object> resolveContext, @NotNull String s, @NotNull ResourceContext resourceContext, @Nullable Resource resource) Returns a resource from this resource provider ornullif the resource provider cannot find it.getResource(ResolveContext resolveContext, String path) booleanlistChildren(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:ResourceProviderReturns a resource from this resource provider ornullif the resource provider cannot find it. The path must have theResourceProvider.PROPERTY_ROOTstrings 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:
getResourcein classResourceProvider<Object>- Parameters:
resolveContext- TheResolveContext.s- The full path of the resource.resourceContext- Additional information for resolving the resourceresource- Optional parent resource- Returns:
nullIf this provider does not have a resource for the path.
-
getResource
-
listChildren
Description copied from class:ResourceProviderReturns anIteratorofResourceobjects loaded from the children of the givenResource. The returnedResourceinstances are attached to the sameResourceResolveras the givenparentresource.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
SyntheticResourceobjects 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:
listChildrenin classResourceProvider<Object>- Parameters:
ctx- TheResolveContext.parent- TheResourcewhose children are requested.- Returns:
- An
IteratorofResourceobjects ornullif the resource provider has no children for the given resource.
-