Resource Streams in Apache Sling | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

7 replies

Radha_Krishna_N
Level 3
Oct 28, 2018 11:55 PM UTC

Thanks dan.klco​ for the article.

1. Can this API be used to set properties on the resource while traversing?

2. If yes, how do we pass resource resolver to commit?

Thanks,

Radha Krishna N

Translate
dan_klco
dan_klcoAuthor
Level 4
Oct 31, 2018 12:55 PM UTC

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.

Translate
Peter_Puzanovs
New Participant
Oct 10, 2018 9:18 AM UTC

Dear Dan,

Thank you for sharing this useful information,

Is there any need to close Stream ourselves or would it be hanlded by Sling?

Regards,

Peter

Translate
dan_klco
dan_klcoAuthor
Level 4
Oct 10, 2018 12:57 PM UTC

PuzanovsP​ - The Stream in question is a java.util.stream.Stream so it doesn't need to be closed.

Translate
arunpatidar
New Participant
Oct 10, 2018 4:05 PM UTC

Thanks dan.klco​ for sharing this.

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.

Translate
Arun Patidar