DaoResult<Folder> result = folderDao.pageFolders(user, 0, 0);
return result.getSize();
}
public Folder createFolder(User user, String folderName, String description) throws NoSuchUserException{
Folder folder = new Folder();
GnizrDaoUtil.fillId(userDao, user);
folder.setUser(user);
if(folderName == null || folderName.length()==0){
throw new IllegalArgumentException("Defined folder name string is NULL or its length() is 0");
}else{
folder.setName(folderName);
}
if(description == null){
folder.setDescription("");
}else{
folder.setDescription(description);
}
folder.setLastUpdated(GnizrDaoUtil.getNow());
int fid = folderDao.createFolder(folder);
folder = folderDao.getFolder(fid);
return folder;
}