X-Git-Url: https://code.grnet.gr/git/pithos/blobdiff_plain/4684df80be00b96e2e22a5b9184e63d0827ff895..daadfde6f22a79b23e74fd095f6ef8a38e846b96:/src/gr/ebs/gss/server/ejb/ExternalAPIBean.java diff --git a/src/gr/ebs/gss/server/ejb/ExternalAPIBean.java b/src/gr/ebs/gss/server/ejb/ExternalAPIBean.java index ea6f3be..b6b90b8 100644 --- a/src/gr/ebs/gss/server/ejb/ExternalAPIBean.java +++ b/src/gr/ebs/gss/server/ejb/ExternalAPIBean.java @@ -264,7 +264,7 @@ public class ExternalAPIBean implements ExternalAPI, ExternalAPIRemote { } @Override - public void createFolder(Long userId, Long parentId, String name) + public FolderDTO createFolder(Long userId, Long parentId, String name) throws DuplicateNameException, ObjectNotFoundException, InsufficientPermissionsException { // Validate. if (userId == null) @@ -291,7 +291,7 @@ public class ExternalAPIBean implements ExternalAPI, ExternalAPIRemote { " to write to this folder"); // Do the actual work. - createFolder(name, parent, creator); + return createFolder(name, parent, creator); } /** @@ -300,8 +300,9 @@ public class ExternalAPIBean implements ExternalAPI, ExternalAPIRemote { * @param name * @param parent * @param creator + * @return the new folder */ - private void createFolder(String name, Folder parent, User creator) { + private FolderDTO createFolder(String name, Folder parent, User creator) { Folder folder = new Folder(); folder.setName(name); if (parent != null) { @@ -337,6 +338,7 @@ public class ExternalAPIBean implements ExternalAPI, ExternalAPIRemote { folder.addPermission(permission); } dao.create(folder); + return folder.getDTO(); } /* @@ -406,7 +408,7 @@ public class ExternalAPIBean implements ExternalAPI, ExternalAPIRemote { } @Override - public void modifyFolder(Long userId, Long folderId, String folderName) + public FolderDTO modifyFolder(Long userId, Long folderId, String folderName) throws InsufficientPermissionsException, ObjectNotFoundException, DuplicateNameException { // Validate. @@ -430,6 +432,7 @@ public class ExternalAPIBean implements ExternalAPI, ExternalAPIRemote { // Do the actual modification. folder.setName(folderName); dao.update(folder); + return folder.getDTO(); } /*