Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-2641

Make listChildren() Iterable

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      When you call Resource.listChildren() or resourceResolver.listChildren() it returns a Iterator<Resource>, this is fine if you want to just iterate through the results using old-style while loops, but if you want to use enhanced loops, you are out of luck.

      I'm proposing adding an interface to return from these methods which extends both Iterator<Resource> and Iterable<Resource>. This will allow for using enhanced loops with the results of listChildren().

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            cziegeler Carsten Ziegeler
            klcodanr Dan Klco
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment