return root.getEntity();
}
String[] chain;
chain = FolderUtil.getPathChain(path);
String currentDir = "";
FolderEntity parent = root.getEntity();
for (String dir : chain) {
currentDir += "/" + dir;
TreeItemDecorator<FolderEntity> folder = findFolderByPath(root,
currentDir);
if (folder == null) {
if (haveWriteAccess(parent)) {
FolderEntity newFolder = new FolderEntity(dir);
newFolder.setParent(parent.getId());
getDao().getFolderDao().save(newFolder);
parent = newFolder;
}
else {
logger.error("access denied " + path);