Best Way to Sort a List of Resources ?
Hi everyone,
As you all probably know im new to CQ.
I have been looking over the APIs, and was wondering what the best solution is to sort a list of Resources.
My current snippet is :
Iterator<Resource> myResources = res.listChildren(); while (myResources.hasNext()) { Resource resource = myResources.next(); String name = resource.getName(); LOGGER.info("The node found is = " + name); }
So what I need to do is sort the resources by name before I loop? Do I need a custom comparator for this or is there something in the CQ APIs that will do the job?
I.e it would be nice to use Collections.sort etc...
Thanks