When ResourceStream traverse resource or resource tree , is it using kind of index? I am just wondering if it is not using index while search then query should be costly as compare to JCR queries.
Arun Patidar - It is doing repository traversals, not using indices. Similar to SlingQuery, it's going to be best for relatively shallow or targeted Resources structures vs. JCR Queries which are more appropriate for deeper structures or searches across the entire repository.
Yes, once you have a stream of resources you could perform a forEach action upon those resources. In this case you would probably commit your changes once complete rather than passing in the resolver and committing after every update.