in src/main/java/org/apache/sling/bundleresource/impl/BundleResourceProvider.java [165:184]
public Iterator<Resource> listChildren(final ResolveContext<Object> ctx, final Resource parent) {
if (parent instanceof BundleResource && ((BundleResource)parent).getBundle() == this.cache) {
// bundle resources can handle this request directly when the parent
// resource is in the same bundle as this provider.
return new BundleResourceIterator((BundleResource) parent);
}
// ensure this provider may have children of the parent
String parentPath = parent.getPath();
PathMapping mappedPath = getMappedPath(parentPath);
if (mappedPath != null) {
return new BundleResourceIterator(parent.getResourceResolver(),
cache, mappedPath, parentPath, null);
}
// the parent resource cannot have children in this provider,
// though this is basically not expected, we still have to
// be prepared for such a situation
return null;
}