https://github.com/apache/sling-org-apache-sling-api/pull/4
I've created a pull request to add a new class to the Sling API bundle that would allow you to create a Stream<Resource> object which traverses a resource tree. Additionally, the ResourceStream class has convenience methods to specify a predicate that identifies valid resources, a limit to the number of valid items that are returned and a range method. There is also a core feature of branch selection that allows you to customize the traversal so that it you can limit the branches that the traversal proceeds down. If you have concerns or questions, now's the time to raise it. - Jason