use of org.apache.sling.caconfig.resource.spi.ContextResource in project sling by apache.
the class ContextPathStrategyMultiplexerImplTest method registerContextPathStrategy.
private void registerContextPathStrategy(String... paths) {
final List<Resource> resources = new ArrayList<>();
for (String path : paths) {
Resource resource = context.resourceResolver().getResource(path);
if (resource != null) {
resources.add(resource);
}
}
context.registerService(ContextPathStrategy.class, new ContextPathStrategy() {
@Override
public Iterator<ContextResource> findContextResources(Resource resource) {
return toContextResourceIterator(resources.iterator());
}
});
}
Aggregations