[
https://issues.apache.org/jira/browse/SLING-2723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13571054#comment-13571054
]
Carsten Ziegeler commented on SLING-2723:
-----------------------------------------
I don't think it would be confusing to have this in ResourceUtil - for example,
we already have the adaptTo(Iterator<Resource>) method there. Filtering the
resources is an "add-on" to the current resource resolver listChildren methode,
which means the resource resolver must fetch the children (or one by one)
before it can apply the filter. So this can easily be done in an utility method.
A specification pattern would have the advantage that we could delegate this
down to the resource providers and providers could implement this in some more
efficient way than getting the resource and comparing properties etc. However,
I'm not quiet convinced that something like this is really needed. A filter
looks the simpler solution which fits the needs.
> Add listChildren(Filter<Resource> filter) to Resource
> -----------------------------------------------------
>
> Key: SLING-2723
> URL: https://issues.apache.org/jira/browse/SLING-2723
> Project: Sling
> Issue Type: Improvement
> Components: Commons
> Affects Versions: API 2.3.0
> Reporter: Feike Visser
> Priority: Minor
>
> Currently there is Resource.listChildren(), this will return all the children
> of this resource.
> This improvement is to add a listChildren(Filter<Resource> filter) method
> where you can specify a specific filter to limit the result, so you don't
> have to code a loop yourself.
> An example can found in the Page-interface.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira