/** * Gets collection. * * @param parent The parent. * @param name The name. * @return The collection item. * @throws Exception - if something is wrong this exception is thrown. */ private CollectionItem getCollection(CollectionItem parent, String name) throws Exception { for (Item child : (Set<Item>) parent.getChildren()) { if (child.getName().equals(name)) { return (CollectionItem) child; } } CollectionItem collection = new HibCollectionItem(); collection.setName(name); collection.setDisplayName(name); collection.setOwner(parent.getOwner()); return contentDao.createCollection(parent, collection); }