Class LocationCollector
java.lang.Object
org.apache.sling.servlets.resolver.internal.helper.LocationCollector
The
LocationCollector
provides access to an ordered collection
of absolute paths containing potential request handling. The primary order of
the collection is the resource type hierarchy with the base resource type at
the top. The secondary order is the search path retrieved from the resource
resolver.
Example: For a node type hierarchy "sample" > "super" > "default" and a search path of [ "/apps", "/libs" ], the iterator would provide access to the following list of paths:
/apps/sample
/libs/sample
/apps/super
/libs/super
/apps/default
/libs/default
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clearCache
(ResourceResolver resolver) Purge all cache entries owned by the LocationCollectorprotected static @NotNull Resource
getResource
(@NotNull ResourceResolver resolver, @NotNull String path, @NotNull Map<String, Resource> cacheMap) Resolve a path to a resource, either via the cache or the ResourceResolver
-
Field Details
-
CACHE_KEY
-
-
Method Details
-
getResource
@NotNull protected static @NotNull Resource getResource(@NotNull @NotNull ResourceResolver resolver, @NotNull @NotNull String path, @NotNull @NotNull Map<String, Resource> cacheMap) Resolve a path to a resource, either via the cache or the ResourceResolver- Parameters:
resolver
-path
-cacheMap
- the cache map to use- Returns:
- a synthetic or "real" resource
-
clearCache
Purge all cache entries owned by the LocationCollector- Parameters:
resolver
- the resolver owning that cache
-