private void initFolders() {
List<FolderEntity> roots = getDao().getFolderDao().getByParent(null);
if (roots.size() == 0) {
log.info("Adding default folders.");
FolderEntity root = new FolderEntity("file", "/", null);
getDao().getFolderDao().save(root);
FolderEntity theme = new FolderEntity("Themes resources", "theme", root.getId());
getDao().getFolderDao().save(theme);
FolderEntity simple = new FolderEntity("Simple", "simple", theme.getId());
getDao().getFolderDao().save(simple);
getBusiness().getFolderPermissionBusiness().setPermission(
root, guests, FolderPermissionType.READ);
FolderEntity tmp = new FolderEntity("tmp", "tmp", root.getId());
getDao().getFolderDao().save(tmp);
getBusiness().getFolderPermissionBusiness().setPermission(
tmp, guests, FolderPermissionType.WRITE);
FolderEntity page = new FolderEntity("page", "page", root.getId());
getDao().getFolderDao().save(page);
}
}