this.isFoldersInit = true;
return this.collection.getFolders();
} else if (method.getName().equals("getGroups") && !this.isGroupsInit) {
List groups = new ArrayList();
GroupDao groupDao = GroupDao.createInstance();
Node node = session.getNodeByUUID(this.collection.getId());
if (!node.hasNode(NodesTypes.PREFIX + GROUPS_NODE_NAME)) {
return groups;
}
for (NodeIterator ni = node.getNode(NodesTypes.PREFIX + GROUPS_NODE_NAME).getNodes(); ni.hasNext(); ) {
Node groupNode = ni.nextNode();
Group group = groupDao.retrieve(groupNode.getUUID());
groups.add(group);
}
this.collection.setGroups(groups);
this.isGroupsInit = true;
return this.collection.getGroups();