this.isCollectionsInit = true;
return this.collection.getCollections();
} else if (method.getName().equals("getFolders") && !this.isFoldersInit) {
List folders = new ArrayList();
FolderDao folderDao = FolderDao.createInstance();
Node node = session.getNodeByUUID(this.collection.getId());
if (!node.hasNode(NodesTypes.PREFIX + CollectionDao.FOLDERS_NODE_NAME)) {
this.isFoldersInit = true;
return folders;
}
for (NodeIterator ni = node.getNode(NodesTypes.PREFIX + CollectionDao.FOLDERS_NODE_NAME).getNodes(); ni.hasNext(); ) {
Node folderNode = ni.nextNode();
Folder folder = folderDao.retrieve(folderNode.getUUID());
folders.add(folder);
}
Collections.sort(folders, new Comparator() {
public int compare(Object arg0, Object arg1) {
Collator comp = Collator.getInstance(Locale.US);