From a52ea5e4e4553c3b1c16713830eccd97d24eefb3 Mon Sep 17 00:00:00 2001 From: pastith Date: Wed, 11 Mar 2009 16:16:32 +0000 Subject: [PATCH] Merge the web_client_signed branch. Now the Web client communicates solely through the REST API with the server. Also, modified the hosted mode launchers a bit to pass the token as a parameter to the client. --- gss/GSS-ubuntu64.launch | 2 +- gss/GSS.launch | 50 +- gss/src/gr/ebs/gss/GSS.gwt.xml | 14 +- gss/src/gr/ebs/gss/client/CredentialsDialog.java | 7 +- gss/src/gr/ebs/gss/client/DeleteFileDialog.java | 101 ++-- gss/src/gr/ebs/gss/client/DeleteFolderDialog.java | 58 +- gss/src/gr/ebs/gss/client/DeleteGroupDialog.java | 48 +- gss/src/gr/ebs/gss/client/DeleteUserDialog.java | 49 +- gss/src/gr/ebs/gss/client/FileContextMenu.java | 86 ++- gss/src/gr/ebs/gss/client/FileList.java | 337 +++++------ gss/src/gr/ebs/gss/client/FileMenu.java | 14 +- .../gr/ebs/gss/client/FilePropertiesDialog.java | 222 +++---- gss/src/gr/ebs/gss/client/FileUpdateDialog.java | 65 +- gss/src/gr/ebs/gss/client/FileUploadDialog.java | 94 +-- gss/src/gr/ebs/gss/client/FolderContextMenu.java | 23 +- .../gr/ebs/gss/client/FolderPropertiesDialog.java | 205 ++++--- gss/src/gr/ebs/gss/client/Folders.java | 190 +++--- gss/src/gr/ebs/gss/client/GSS.java | 130 ++-- gss/src/gr/ebs/gss/client/GSSService.java | 421 ------------- gss/src/gr/ebs/gss/client/GSSServiceAsync.java | 252 -------- gss/src/gr/ebs/gss/client/GroupMenu.java | 53 +- .../gr/ebs/gss/client/GroupPropertiesDialog.java | 48 +- gss/src/gr/ebs/gss/client/Groups.java | 139 +++-- .../gr/ebs/gss/client/PermissionsAddDialog.java | 57 +- gss/src/gr/ebs/gss/client/PermissionsList.java | 48 +- gss/src/gr/ebs/gss/client/PopupTree.java | 38 +- gss/src/gr/ebs/gss/client/SearchResults.java | 139 +++-- gss/src/gr/ebs/gss/client/ServerSuggestOracle.java | 225 ------- gss/src/gr/ebs/gss/client/StatusPanel.java | 40 +- gss/src/gr/ebs/gss/client/TopPanel.java | 4 +- gss/src/gr/ebs/gss/client/UserAddDialog.java | 67 +-- gss/src/gr/ebs/gss/client/VersionsList.java | 79 +-- .../gr/ebs/gss/client/clipboard/ClipboardItem.java | 84 +-- .../gr/ebs/gss/client/commands/CopyCommand.java | 27 +- gss/src/gr/ebs/gss/client/commands/CutCommand.java | 23 +- .../gr/ebs/gss/client/commands/DeleteCommand.java | 12 +- .../client/commands/DeleteUserOrGroupCommand.java | 8 +- .../ebs/gss/client/commands/EmptyTrashCommand.java | 36 +- .../ebs/gss/client/commands/NewFolderCommand.java | 84 ++- .../gr/ebs/gss/client/commands/PasteCommand.java | 410 ++++++------- .../ebs/gss/client/commands/PropertiesCommand.java | 211 +++---- .../commands/ResreshOthersSharesCommand.java | 2 +- .../gss/client/commands/RestoreTrashCommand.java | 137 +++-- .../gr/ebs/gss/client/commands/ToTrashCommand.java | 123 ++-- .../ebs/gss/client/commands/UpdateFileCommand.java | 4 +- .../ebs/gss/client/commands/UploadFileCommand.java | 37 +- .../gr/ebs/gss/client/dnd/DnDDropController.java | 46 +- gss/src/gr/ebs/gss/client/dnd/DnDFocusPanel.java | 8 +- .../gr/ebs/gss/client/dnd/DnDFolderPopupMenu.java | 330 +++++----- gss/src/gr/ebs/gss/client/dnd/DnDTreeItem.java | 117 +++- .../ebs/gss/client/rest/AbstractRestCommand.java | 129 ++++ gss/src/gr/ebs/gss/client/rest/CallbackList.java | 74 +++ gss/src/gr/ebs/gss/client/rest/ExecuteDelete.java | 87 +++ gss/src/gr/ebs/gss/client/rest/ExecuteGet.java | 209 +++++++ gss/src/gr/ebs/gss/client/rest/ExecuteHead.java | 150 +++++ .../ebs/gss/client/rest/ExecuteMultipleDelete.java | 116 ++++ .../gr/ebs/gss/client/rest/ExecuteMultipleGet.java | 217 +++++++ .../ebs/gss/client/rest/ExecuteMultipleHead.java | 179 ++++++ .../ebs/gss/client/rest/ExecuteMultiplePost.java | 129 ++++ gss/src/gr/ebs/gss/client/rest/ExecutePost.java | 93 +++ gss/src/gr/ebs/gss/client/rest/RestCallback.java | 69 +++ gss/src/gr/ebs/gss/client/rest/RestException.java | 67 +++ .../gr/ebs/gss/client/rest/RestGetCallback.java | 67 +++ .../ebs/gss/client/rest/resource/FileResource.java | 439 ++++++++++++++ .../gss/client/rest/resource/FolderResource.java | 434 +++++++++++++ .../gss/client/rest/resource/GroupResource.java | 73 +++ .../client/rest/resource/GroupUserResource.java | 104 ++++ .../gss/client/rest/resource/GroupsResource.java | 74 +++ .../client/rest/resource/OtherUserResource.java | 211 +++++++ .../gss/client/rest/resource/OthersResource.java | 73 +++ .../gss/client/rest/resource/PermissionHolder.java | 128 ++++ .../ebs/gss/client/rest/resource/QuotaHolder.java | 117 ++++ .../ebs/gss/client/rest/resource/RestResource.java | 84 +++ .../gss/client/rest/resource/SearchResource.java | 68 +++ .../gss/client/rest/resource/SharedResource.java | 199 ++++++ .../ebs/gss/client/rest/resource/TagsResource.java | 69 +++ .../gss/client/rest/resource/TrashResource.java | 194 ++++++ .../client/rest/resource/UploadStatusResource.java | 91 +++ .../ebs/gss/client/rest/resource/UserResource.java | 313 ++++++++++ gss/src/gr/ebs/gss/client/tree/FolderSubtree.java | 196 +++--- gss/src/gr/ebs/gss/client/tree/MyShareSubtree.java | 278 +++++---- .../ebs/gss/client/tree/OthersSharesSubtree.java | 280 ++++----- gss/src/gr/ebs/gss/client/tree/Subtree.java | 79 +-- gss/src/gr/ebs/gss/client/tree/TrashSubtree.java | 130 ++-- gss/src/gr/ebs/gss/public/GSS.html | 2 + gss/src/gr/ebs/gss/public/sha1.js | 202 +++++++ gss/src/gr/ebs/gss/server/FileDownload.java | 152 ----- gss/src/gr/ebs/gss/server/FileUpload.java | 268 --------- gss/src/gr/ebs/gss/server/GSSServiceImpl.java | 636 -------------------- gss/test/gr/ebs/gss/client/UserGroupsTest.java | 99 --- gss/war/WEB-INF/web.xml | 24 - 91 files changed, 7198 insertions(+), 4409 deletions(-) delete mode 100644 gss/src/gr/ebs/gss/client/GSSService.java delete mode 100644 gss/src/gr/ebs/gss/client/GSSServiceAsync.java delete mode 100644 gss/src/gr/ebs/gss/client/ServerSuggestOracle.java create mode 100644 gss/src/gr/ebs/gss/client/rest/AbstractRestCommand.java create mode 100644 gss/src/gr/ebs/gss/client/rest/CallbackList.java create mode 100644 gss/src/gr/ebs/gss/client/rest/ExecuteDelete.java create mode 100644 gss/src/gr/ebs/gss/client/rest/ExecuteGet.java create mode 100644 gss/src/gr/ebs/gss/client/rest/ExecuteHead.java create mode 100644 gss/src/gr/ebs/gss/client/rest/ExecuteMultipleDelete.java create mode 100644 gss/src/gr/ebs/gss/client/rest/ExecuteMultipleGet.java create mode 100644 gss/src/gr/ebs/gss/client/rest/ExecuteMultipleHead.java create mode 100644 gss/src/gr/ebs/gss/client/rest/ExecuteMultiplePost.java create mode 100644 gss/src/gr/ebs/gss/client/rest/ExecutePost.java create mode 100644 gss/src/gr/ebs/gss/client/rest/RestCallback.java create mode 100644 gss/src/gr/ebs/gss/client/rest/RestException.java create mode 100644 gss/src/gr/ebs/gss/client/rest/RestGetCallback.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/FileResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/FolderResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/GroupResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/GroupUserResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/GroupsResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/OtherUserResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/OthersResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/PermissionHolder.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/QuotaHolder.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/RestResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/SearchResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/SharedResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/TagsResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/TrashResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/UploadStatusResource.java create mode 100644 gss/src/gr/ebs/gss/client/rest/resource/UserResource.java create mode 100644 gss/src/gr/ebs/gss/public/sha1.js delete mode 100644 gss/src/gr/ebs/gss/server/FileDownload.java delete mode 100644 gss/src/gr/ebs/gss/server/FileUpload.java delete mode 100644 gss/src/gr/ebs/gss/server/GSSServiceImpl.java delete mode 100644 gss/test/gr/ebs/gss/client/UserGroupsTest.java diff --git a/gss/GSS-ubuntu64.launch b/gss/GSS-ubuntu64.launch index fbc25b1..8e6cc3e 100644 --- a/gss/GSS-ubuntu64.launch +++ b/gss/GSS-ubuntu64.launch @@ -19,7 +19,7 @@ - + diff --git a/gss/GSS.launch b/gss/GSS.launch index 7f59f6e..cf7e3ab 100644 --- a/gss/GSS.launch +++ b/gss/GSS.launch @@ -1,25 +1,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gss/src/gr/ebs/gss/GSS.gwt.xml b/gss/src/gr/ebs/gss/GSS.gwt.xml index ba4febb..596e98d 100644 --- a/gss/src/gr/ebs/gss/GSS.gwt.xml +++ b/gss/src/gr/ebs/gss/GSS.gwt.xml @@ -1,11 +1,13 @@ - - + + + + - - - - + + + + diff --git a/gss/src/gr/ebs/gss/client/CredentialsDialog.java b/gss/src/gr/ebs/gss/client/CredentialsDialog.java index 19e62e4..480e271 100644 --- a/gss/src/gr/ebs/gss/client/CredentialsDialog.java +++ b/gss/src/gr/ebs/gss/client/CredentialsDialog.java @@ -36,7 +36,6 @@ import com.google.gwt.user.client.ui.Widget; * */ public class CredentialsDialog extends DialogBox { - /** * The widget constructor. */ @@ -63,12 +62,12 @@ public class CredentialsDialog extends DialogBox { table.setText(0, 0, "Username"); table.setText(1, 0, "Token"); TextBox username = new TextBox(); - username.setText(GSS.get().getCurrentUser().getUsername()); + username.setText(GSS.get().getCurrentUserResource().getUsername()); username.setReadOnly(true); table.setWidget(0, 1, username); TextBox tokenBox = new TextBox(); tokenBox.setText(token); - tokenBox.setReadOnly(true); + tokenBox.setReadOnly(false); table.setWidget(1, 1, tokenBox); table.getFlexCellFormatter().setStyleName(0, 0, "props-labels"); table.getFlexCellFormatter().setStyleName(0, 1, "props-values"); @@ -108,4 +107,6 @@ public class CredentialsDialog extends DialogBox { return true; } + + } diff --git a/gss/src/gr/ebs/gss/client/DeleteFileDialog.java b/gss/src/gr/ebs/gss/client/DeleteFileDialog.java index a24ba68..005369b 100644 --- a/gss/src/gr/ebs/gss/client/DeleteFileDialog.java +++ b/gss/src/gr/ebs/gss/client/DeleteFileDialog.java @@ -20,13 +20,16 @@ package gr.ebs.gss.client; import gr.ebs.gss.client.MessagePanel.Images; import gr.ebs.gss.client.domain.FileHeaderDTO; -import gr.ebs.gss.client.exceptions.RpcException; +import gr.ebs.gss.client.rest.ExecuteDelete; +import gr.ebs.gss.client.rest.ExecuteMultipleDelete; +import gr.ebs.gss.client.rest.RestException; +import gr.ebs.gss.client.rest.resource.FileResource; import java.util.ArrayList; import java.util.List; import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.DialogBox; @@ -72,7 +75,7 @@ public class DeleteFileDialog extends DialogBox { final Button ok = new Button("Delete the file", new ClickListener() { public void onClick(Widget sender) { - deleteFile(GSS.get().getCurrentUser().getId()); + deleteFile(); hide(); } }); @@ -103,59 +106,75 @@ public class DeleteFileDialog extends DialogBox { * * @param userId the ID of the current user */ - private void deleteFile(final Long userId) { - final GSSServiceAsync service = GSS.get().getRemoteService(); + private void deleteFile() { final Object selection = GSS.get().getCurrentSelection(); if (selection == null) { GSS.get().displayError("No file was selected!"); return; } - if (selection instanceof FileHeaderDTO) { - FileHeaderDTO file = (FileHeaderDTO) selection; - final Long fileId = file.getId(); - GWT.log("deleteFile(" + userId + "," + fileId + ")", null); - GSS.get().showLoadingIndicator(); - service.deleteFile(userId, fileId, new AsyncCallback() { - - public void onSuccess(final Object result) { - GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId()); + if (selection instanceof FileResource) { + FileResource file = (FileResource) selection; + ExecuteDelete df = new ExecuteDelete(file.getPath()){ + + public void onComplete() { + GSS.get().getFileList().updateFileCache(true); GSS.get().getStatusPanel().updateStats(); - GSS.get().hideLoadingIndicator(); } - public void onFailure(final Throwable caught) { - GWT.log("", caught); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); + + public void onError(Throwable t) { + GWT.log("", t); + if(t instanceof RestException){ + int statusCode = ((RestException)t).getHttpStatusCode(); + if(statusCode == 405) + GSS.get().displayError("You don't have the necessary permissions"); + else if(statusCode == 404) + GSS.get().displayError("File not found"); + else + GSS.get().displayError("Unable to delete file, status code:"+statusCode+ " "+t.getMessage()); + } else - GSS.get().displayError(caught.getMessage()); - GSS.get().hideLoadingIndicator(); + GSS.get().displayError("System error unable to delete file:"+t.getMessage()); } - }); + }; + DeferredCommand.addCommand(df); + } else if(selection instanceof List){ - List files = (List) selection; - final List fileIds = new ArrayList(); - for(FileHeaderDTO f : files) - fileIds.add(f.getId()); - GSS.get().showLoadingIndicator(); - service.deleteFiles(userId, fileIds, new AsyncCallback() { - - public void onSuccess(final Object result) { - GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId()); - GSS.get().getStatusPanel().updateStats(); - GSS.get().hideLoadingIndicator(); + List files = (List) selection; + final List fileIds = new ArrayList(); + for(FileResource f : files) + fileIds.add(f.getPath()); + ExecuteMultipleDelete ed = new ExecuteMultipleDelete(fileIds.toArray(new String[0])){ + + public void onComplete() { + GSS.get().showFileList(true); } - public void onFailure(final Throwable caught) { - GWT.log("", caught); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); + @Override + public void onError(Throwable t) { + GWT.log("", t); + GSS.get().showFileList(true); + } + + @Override + public void onError(String path, Throwable t) { + GWT.log("", t); + if(t instanceof RestException){ + int statusCode = ((RestException)t).getHttpStatusCode(); + if(statusCode == 405) + GSS.get().displayError("You don't have the necessary permissions"); + else if(statusCode == 404) + GSS.get().displayError("File not found"); + else + GSS.get().displayError("Unable to delete file, status code:"+statusCode+ " "+t.getMessage()); + } else - GSS.get().displayError(caught.getMessage()); - GSS.get().hideLoadingIndicator(); + GSS.get().displayError("System error unable to delete file:"+t.getMessage()); + } - }); + }; + DeferredCommand.addCommand(ed); } } @@ -170,7 +189,7 @@ public class DeleteFileDialog extends DialogBox { switch (key) { case KeyboardListener.KEY_ENTER: hide(); - deleteFile(GSS.get().getCurrentUser().getId()); + deleteFile(); break; case KeyboardListener.KEY_ESCAPE: hide(); diff --git a/gss/src/gr/ebs/gss/client/DeleteFolderDialog.java b/gss/src/gr/ebs/gss/client/DeleteFolderDialog.java index 8654a95..34f8d13 100644 --- a/gss/src/gr/ebs/gss/client/DeleteFolderDialog.java +++ b/gss/src/gr/ebs/gss/client/DeleteFolderDialog.java @@ -19,11 +19,13 @@ package gr.ebs.gss.client; import gr.ebs.gss.client.MessagePanel.Images; -import gr.ebs.gss.client.domain.FolderDTO; -import gr.ebs.gss.client.exceptions.RpcException; +import gr.ebs.gss.client.dnd.DnDTreeItem; +import gr.ebs.gss.client.rest.ExecuteDelete; +import gr.ebs.gss.client.rest.RestException; +import gr.ebs.gss.client.rest.resource.FolderResource; import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.DialogBox; @@ -48,7 +50,7 @@ public class DeleteFolderDialog extends DialogBox { // Use this opportunity to set the dialog's caption. setText("Delete folder"); setAnimationEnabled(true); - final FolderDTO folder = (FolderDTO) GSS.get().getCurrentSelection(); + final FolderResource folder = (FolderResource) GSS.get().getCurrentSelection(); // Create a VerticalPanel to contain the 'about' label and the 'OK' // button. final VerticalPanel outer = new VerticalPanel(); @@ -67,7 +69,7 @@ public class DeleteFolderDialog extends DialogBox { final Button ok = new Button("Delete the folder", new ClickListener() { public void onClick(Widget sender) { - deleteFolder(GSS.get().getCurrentUser().getId()); + deleteFolder(); hide(); } }); @@ -98,32 +100,38 @@ public class DeleteFolderDialog extends DialogBox { * * @param userId the ID of the current user */ - private void deleteFolder(final Long userId) { - final GSSServiceAsync service = GSS.get().getRemoteService(); - final TreeItem folder = GSS.get().getFolders().getCurrent(); + private void deleteFolder() { + + final DnDTreeItem folder = (DnDTreeItem) GSS.get().getFolders().getCurrent(); if (folder == null) { GSS.get().displayError("No folder was selected!"); return; } - final Long folderId = ((FolderDTO) folder.getUserObject()).getId(); - GWT.log("deleteFolder(" + userId + "," + folderId + ")", null); - GSS.get().showLoadingIndicator(); - service.deleteFolder(userId, folderId, new AsyncCallback() { - - public void onSuccess(final Object result) { - GSS.get().getFolders().onFolderDelete(folder); - GSS.get().hideLoadingIndicator(); + if(folder.getFolderResource() == null) + return; + ExecuteDelete df = new ExecuteDelete(folder.getFolderResource().getPath()){ + @Override + public void onComplete() { + TreeItem folder = GSS.get().getFolders().getCurrent(); + GSS.get().getFolders().updateFolder((DnDTreeItem) folder.getParentItem()); } - - public void onFailure(final Throwable caught) { - GWT.log("", caught); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); + public void onError(Throwable t) { + GWT.log("", t); + if(t instanceof RestException){ + int statusCode = ((RestException)t).getHttpStatusCode(); + if(statusCode == 405) + GSS.get().displayError("You don't have the necessary permissions"); + else if(statusCode == 404) + GSS.get().displayError("Folder not found"); + else + GSS.get().displayError("Unable to delete folder, status code:"+statusCode+ " "+t.getMessage()); + } else - GSS.get().displayError(caught.getMessage()); - GSS.get().hideLoadingIndicator(); + GSS.get().displayError("System error unable to delete folder:"+t.getMessage()); } - }); + }; + DeferredCommand.addCommand(df); + } /* @@ -137,7 +145,7 @@ public class DeleteFolderDialog extends DialogBox { switch (key) { case KeyboardListener.KEY_ENTER: hide(); - deleteFolder(GSS.get().getCurrentUser().getId()); + deleteFolder(); break; case KeyboardListener.KEY_ESCAPE: hide(); diff --git a/gss/src/gr/ebs/gss/client/DeleteGroupDialog.java b/gss/src/gr/ebs/gss/client/DeleteGroupDialog.java index c50a768..bc714e0 100644 --- a/gss/src/gr/ebs/gss/client/DeleteGroupDialog.java +++ b/gss/src/gr/ebs/gss/client/DeleteGroupDialog.java @@ -19,11 +19,12 @@ package gr.ebs.gss.client; import gr.ebs.gss.client.MessagePanel.Images; -import gr.ebs.gss.client.domain.GroupDTO; -import gr.ebs.gss.client.exceptions.RpcException; +import gr.ebs.gss.client.rest.ExecuteDelete; +import gr.ebs.gss.client.rest.RestException; +import gr.ebs.gss.client.rest.resource.GroupResource; import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.DialogBox; @@ -48,7 +49,7 @@ public class DeleteGroupDialog extends DialogBox { // Use this opportunity to set the dialog's caption. setText("Delete group"); setAnimationEnabled(true); - final GroupDTO group = (GroupDTO) GSS.get().getCurrentSelection(); + final GroupResource group = (GroupResource) GSS.get().getCurrentSelection(); // Create a VerticalPanel to contain the 'about' label and the 'OK' // button. final VerticalPanel outer = new VerticalPanel(); @@ -56,7 +57,7 @@ public class DeleteGroupDialog extends DialogBox { // Create the 'about' text and set a style name so we can style it with // CSS. - final HTML text = new HTML("
" + images.warn().getHTML() + "" + "Are you sure you want to delete group '" + group.getName() + "'?
"); + final HTML text = new HTML("
" + images.warn().getHTML() + "" + "Are you sure you want to delete group '" + group.getPath() + "'?
"); text.setStyleName("gss-warnMessage"); outer.add(text); @@ -65,7 +66,7 @@ public class DeleteGroupDialog extends DialogBox { final Button ok = new Button("OK", new ClickListener() { public void onClick(Widget sender) { - deleteGroup(GSS.get().getCurrentUser().getId()); + deleteGroup(); hide(); } }); @@ -96,30 +97,33 @@ public class DeleteGroupDialog extends DialogBox { * * @param userId the ID of the current user */ - private void deleteGroup(final Long userId) { - final GSSServiceAsync service = GSS.get().getRemoteService(); + private void deleteGroup() { final TreeItem group = GSS.get().getGroups().getCurrent(); if (group == null) { GSS.get().displayError("No group was selected!"); return; } - final Long groupId = ((GroupDTO) group.getUserObject()).getId(); - GWT.log("deleteGroup(" + userId + "," + groupId + ")", null); - service.deleteGroup(userId, groupId, new AsyncCallback() { - - public void onSuccess(final Object result) { - GSS.get().getGroups().updateGroups(GSS.get().getCurrentUser().getId()); - GSS.get().getFolders().update(GSS.get().getCurrentUser().getId(), GSS.get().getFolders().getMySharesItem()); + ExecuteDelete dg = new ExecuteDelete(((GroupResource)group.getUserObject()).getPath()){ + public void onComplete() { + GSS.get().getGroups().updateGroups(); } - public void onFailure(final Throwable caught) { - GWT.log("", caught); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); + public void onError(Throwable t) { + GWT.log("", t); + if(t instanceof RestException){ + int statusCode = ((RestException)t).getHttpStatusCode(); + if(statusCode == 405) + GSS.get().displayError("You don't have the necessary permissions"); + else if(statusCode == 404) + GSS.get().displayError("Group not found"); + else + GSS.get().displayError("Unable to delete group, status code:"+statusCode+ " "+t.getMessage()); + } else - GSS.get().displayError(caught.getMessage()); + GSS.get().displayError("System error unable to delete group:"+t.getMessage()); } - }); + }; + DeferredCommand.addCommand(dg); } /* @@ -133,7 +137,7 @@ public class DeleteGroupDialog extends DialogBox { switch (key) { case KeyboardListener.KEY_ENTER: hide(); - deleteGroup(GSS.get().getCurrentUser().getId()); + deleteGroup(); break; case KeyboardListener.KEY_ESCAPE: hide(); diff --git a/gss/src/gr/ebs/gss/client/DeleteUserDialog.java b/gss/src/gr/ebs/gss/client/DeleteUserDialog.java index 17eb473..8775d6c 100644 --- a/gss/src/gr/ebs/gss/client/DeleteUserDialog.java +++ b/gss/src/gr/ebs/gss/client/DeleteUserDialog.java @@ -19,12 +19,13 @@ package gr.ebs.gss.client; import gr.ebs.gss.client.MessagePanel.Images; -import gr.ebs.gss.client.domain.GroupDTO; -import gr.ebs.gss.client.domain.UserDTO; -import gr.ebs.gss.client.exceptions.RpcException; +import gr.ebs.gss.client.rest.ExecuteDelete; +import gr.ebs.gss.client.rest.RestException; +import gr.ebs.gss.client.rest.resource.GroupResource; +import gr.ebs.gss.client.rest.resource.GroupUserResource; import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.DialogBox; @@ -51,7 +52,7 @@ public class DeleteUserDialog extends DialogBox { // Use this opportunity to set the dialog's caption. setText("Delete user"); setAnimationEnabled(true); - final UserDTO group = (UserDTO) GSS.get().getCurrentSelection(); + final GroupUserResource group = (GroupUserResource) GSS.get().getCurrentSelection(); // Create a VerticalPanel to contain the 'about' label and the 'OK' // button. final VerticalPanel outer = new VerticalPanel(); @@ -68,7 +69,7 @@ public class DeleteUserDialog extends DialogBox { final Button ok = new Button("OK", new ClickListener() { public void onClick(Widget sender) { - deleteUser(GSS.get().getCurrentUser().getId()); + deleteUser(); hide(); } }); @@ -99,30 +100,38 @@ public class DeleteUserDialog extends DialogBox { * * @param userId the ID of the current user */ - private void deleteUser(final Long userId) { - final GSSServiceAsync service = GSS.get().getRemoteService(); + private void deleteUser() { final TreeItem user = GSS.get().getGroups().getCurrent(); final TreeItem group = user.getParentItem(); if (group == null) { GSS.get().displayError("No user was selected!"); return; } - final Long groupId = ((GroupDTO) group.getUserObject()).getId(); - final Long memberId = ((UserDTO) user.getUserObject()).getId(); - service.removeMemberFromGroup(userId, groupId, memberId, new AsyncCallback() { + final GroupResource groupR = (GroupResource) group.getUserObject(); + final GroupUserResource memberR = (GroupUserResource) user.getUserObject(); + ExecuteDelete du = new ExecuteDelete(memberR.getPath()){ - public void onSuccess(final Object result) { - GSS.get().getGroups().updateGroups(GSS.get().getCurrentUser().getId()); + public void onComplete() { + GSS.get().getGroups().updateGroups(); } - public void onFailure(final Throwable caught) { - GWT.log("", caught); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); + public void onError(Throwable t) { + GWT.log("", t); + if(t instanceof RestException){ + int statusCode = ((RestException)t).getHttpStatusCode(); + if(statusCode == 405) + GSS.get().displayError("You don't have the necessary permissions"); + else if(statusCode == 404) + GSS.get().displayError("User not found"); + else + GSS.get().displayError("Unable to delete user, status code:"+statusCode+ " "+t.getMessage()); + } else - GSS.get().displayError(caught.getMessage()); + GSS.get().displayError("System error unable to delete user:"+t.getMessage()); } - }); + }; + DeferredCommand.addCommand(du); + } /* @@ -136,7 +145,7 @@ public class DeleteUserDialog extends DialogBox { switch (key) { case KeyboardListener.KEY_ENTER: hide(); - deleteUser(GSS.get().getCurrentUser().getId()); + deleteUser(); break; case KeyboardListener.KEY_ESCAPE: hide(); diff --git a/gss/src/gr/ebs/gss/client/FileContextMenu.java b/gss/src/gr/ebs/gss/client/FileContextMenu.java index ed4ea7c..6e41e8f 100644 --- a/gss/src/gr/ebs/gss/client/FileContextMenu.java +++ b/gss/src/gr/ebs/gss/client/FileContextMenu.java @@ -25,7 +25,7 @@ import gr.ebs.gss.client.commands.PropertiesCommand; import gr.ebs.gss.client.commands.RestoreTrashCommand; import gr.ebs.gss.client.commands.ToTrashCommand; import gr.ebs.gss.client.commands.UpdateFileCommand; -import gr.ebs.gss.client.domain.FileHeaderDTO; +import gr.ebs.gss.client.rest.resource.FileResource; import java.util.List; @@ -47,13 +47,21 @@ public class FileContextMenu extends PopupPanel implements ClickListener { * The widget's images. */ private final Images images; + private MenuItem cutItem; + private MenuItem copyItem; + private MenuItem updateItem; + private MenuItem propItem; + private MenuItem trashItem; + private MenuItem deleteItem; + private MenuItem downloadItem; + /** * The image bundle for this widget's images that reuses images defined in * other menus. @@ -79,6 +87,10 @@ public class FileContextMenu extends PopupPanel implements ClickListener { AbstractImagePrototype versions(); } + public static native String getDate()/*-{ + return (new Date()).toUTCString(); + }-*/; + /** * The widget's constructor. * @@ -101,14 +113,15 @@ public class FileContextMenu extends PopupPanel implements ClickListener { }; - // The command that does some validation before downloading a file. - final Command downloadCmd = new Command() { + // The command that does some validation before downloading a file. + final Command downloadCmd = new Command() { + + public void execute() { + hide(); + GSS.get().getTopPanel().getFileMenu().preDownloadCheck(); + } + }; - public void execute() { - hide(); - GSS.get().getTopPanel().getFileMenu().preDownloadCheck(); - } - }; final MenuBar contextMenu = new MenuBar(true); if (isTrash) { @@ -131,60 +144,48 @@ public class FileContextMenu extends PopupPanel implements ClickListener { contextMenu.addItem(trashItem); contextMenu.addItem(deleteItem); String[] link = {"", ""}; - GSS.get().getTopPanel().getFileMenu().createDownloadLink(link); - downloadItem = new MenuItem("" + link[0] + newImages.download().getHTML() + " Download File" + link[1] + "", true, downloadCmd); - contextMenu.addItem(downloadItem); + GSS.get().getTopPanel().getFileMenu().createDownloadLink(link); + downloadItem = new MenuItem("" + link[0] + newImages.download().getHTML() + " Download File" + link[1] + "", true, downloadCmd); + contextMenu.addItem(downloadItem); + } add(contextMenu); - // Postpone the addition of the Download File menu option in order - // to finish the object construction phase, since we need a reference - // to a properly initialized GSS object. - //DeferredCommand.addCommand(new Command() { - - //public void execute() { - // Construct a download URL in order to force the browser to - // actually download a file. - //String[] link = {"", ""}; - //GSS.get().getTopPanel().getFileMenu().createDownloadLink(link); - //downloadItem = new MenuItem("" + link[0] + newImages.download().getHTML() + " Download File" + link[1] + "", true, downloadCmd); - //contextMenu.addItem(downloadItem); - //} - //}); } - void onMultipleSelection(){ + void onMultipleSelection() { updateItem.setVisible(false); propItem.setVisible(false); downloadItem.setVisible(false); } + /* * (non-Javadoc) * * @see com.google.gwt.user.client.ui.ClickListener#onClick(com.google.gwt.user.client.ui.Widget) */ public void onClick(final Widget sender) { - Object curSel = GSS.get().getCurrentSelection(); - if (curSel != null) { - FileContextMenu menu = null; - if(curSel instanceof FileHeaderDTO){ - FileHeaderDTO dto = (FileHeaderDTO)curSel; - if(dto.isDeleted()) - menu = new FileContextMenu(images,true); + + if (GSS.get().getCurrentSelection() != null) + if (GSS.get().getCurrentSelection() instanceof FileResource) { + FileResource res = (FileResource) GSS.get().getCurrentSelection(); + FileContextMenu menu; + if (res.isDeleted()) + menu = new FileContextMenu(images, true); else - menu = new FileContextMenu(images,false); + menu = new FileContextMenu(images, false); int left = sender.getAbsoluteLeft(); int top = sender.getAbsoluteTop() + sender.getOffsetHeight(); menu.setPopupPosition(left, top); menu.show(); - } - else if(curSel instanceof List){ - List dto = (List)curSel; - if(GSS.get().getFolders().isTrashItem(GSS.get().getFolders().getCurrent())) - menu = new FileContextMenu(images,true); - else{ - menu = new FileContextMenu(images,false); + } else if (GSS.get().getCurrentSelection() instanceof List) { + List dto = (List) GSS.get().getCurrentSelection(); + FileContextMenu menu; + if (GSS.get().getFolders().isTrashItem(GSS.get().getFolders().getCurrent())) + menu = new FileContextMenu(images, true); + else { + menu = new FileContextMenu(images, false); menu.onMultipleSelection(); } int left = sender.getAbsoluteLeft(); @@ -192,8 +193,5 @@ public class FileContextMenu extends PopupPanel implements ClickListener { menu.setPopupPosition(left, top); menu.show(); } - - - } } } diff --git a/gss/src/gr/ebs/gss/client/FileList.java b/gss/src/gr/ebs/gss/client/FileList.java index 24c99e0..0ceeafe 100644 --- a/gss/src/gr/ebs/gss/client/FileList.java +++ b/gss/src/gr/ebs/gss/client/FileList.java @@ -19,10 +19,13 @@ package gr.ebs.gss.client; import gr.ebs.gss.client.dnd.DnDFocusPanel; -import gr.ebs.gss.client.domain.FileHeaderDTO; -import gr.ebs.gss.client.domain.FolderDTO; -import gr.ebs.gss.client.domain.UserDTO; -import gr.ebs.gss.client.exceptions.RpcException; +import gr.ebs.gss.client.dnd.DnDTreeItem; +import gr.ebs.gss.client.rest.ExecuteGet; +import gr.ebs.gss.client.rest.RestException; +import gr.ebs.gss.client.rest.resource.FileResource; +import gr.ebs.gss.client.rest.resource.FolderResource; +import gr.ebs.gss.client.rest.resource.TrashResource; +import gr.ebs.gss.client.rest.resource.UserResource; import java.util.ArrayList; import java.util.Collections; @@ -35,7 +38,6 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.IncrementalCommand; -import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.AbstractImagePrototype; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.Composite; @@ -101,7 +103,7 @@ public class FileList extends Composite implements TableListener, ClickListener /** * The table widget with the file list. */ - private Grid table = new Grid(GSSService.VISIBLE_FILE_COUNT + 1, 8); + private Grid table = new Grid(GSS.VISIBLE_FILE_COUNT + 1, 8); /** * The navigation bar for paginating the results. @@ -116,12 +118,8 @@ public class FileList extends Composite implements TableListener, ClickListener /** * A cache of the files in the list. */ - private List files; + private List files; - /** - * A proxy handler for the remote GSS service. - */ - private final GSSServiceAsync service; /** * The widget's image bundle. @@ -141,6 +139,7 @@ public class FileList extends Composite implements TableListener, ClickListener private HTML dateLabel; private HTML ownerLabel; + /** * Construct the file list widget. This entails setting up the widget * layout, fetching the number of files in the current folder from the @@ -158,8 +157,7 @@ public class FileList extends Composite implements TableListener, ClickListener contextMenu = new DnDFocusPanel(new HTML(images.fileContextMenu().getHTML())); contextMenu.addClickListener(new FileContextMenu(images, false)); GSS.get().getDragController().makeDraggable(contextMenu); - // Set up the service proxy - service = GSS.get().getRemoteService(); + // Setup the table. table.setCellSpacing(0); @@ -201,15 +199,15 @@ public class FileList extends Composite implements TableListener, ClickListener if (sender == nextButton) { // Move forward a page. clearSelectedRows(); - startIndex += GSSService.VISIBLE_FILE_COUNT; + startIndex += GSS.VISIBLE_FILE_COUNT; if (startIndex >= folderFileCount) - startIndex -= GSSService.VISIBLE_FILE_COUNT; + startIndex -= GSS.VISIBLE_FILE_COUNT; else update(); } else if (sender == prevButton) { clearSelectedRows(); // Move back a page. - startIndex -= GSSService.VISIBLE_FILE_COUNT; + startIndex -= GSS.VISIBLE_FILE_COUNT; if (startIndex < 0) startIndex = 0; else @@ -218,7 +216,8 @@ public class FileList extends Composite implements TableListener, ClickListener } public void onBrowserEvent(Event event) { - if(files ==null || files.size() == 0) return; + if (files == null || files.size() == 0) + return; if (DOM.eventGetType(event) == Event.ONCONTEXTMENU && selectedRows.size() != 0) { FileContextMenu fm = new FileContextMenu(images, false); fm.onClick(contextMenu); @@ -249,10 +248,10 @@ public class FileList extends Composite implements TableListener, ClickListener * @return true if the retrieval was successful */ protected boolean fetchRootFolder() { - UserDTO user = GSS.get().getCurrentUser(); + UserResource user = GSS.get().getCurrentUserResource(); if (user == null) return !DONE; - updateFileCache(user.getId()); + updateFileCache(); return DONE; } @@ -363,7 +362,7 @@ public class FileList extends Composite implements TableListener, ClickListener // table.setText(0, 1, "Name"); table.setWidget(0, 1, nameLabel); table.setWidget(0, 2, ownerLabel); - //table.setText(0, 2, "Owner"); + // table.setText(0, 2, "Owner"); // table.setText(0, 3, "Version"); table.setWidget(0, 3, versionLabel); // table.setText(0, 4, "Size"); @@ -374,7 +373,7 @@ public class FileList extends Composite implements TableListener, ClickListener table.getRowFormatter().setStyleName(0, "gss-ListHeader"); // Initialize the rest of the rows. - for (int i = 1; i < GSSService.VISIBLE_FILE_COUNT + 1; ++i) { + for (int i = 1; i < GSS.VISIBLE_FILE_COUNT + 1; ++i) { table.setText(i, 0, ""); table.setText(i, 1, ""); table.setText(i, 2, ""); @@ -430,24 +429,11 @@ public class FileList extends Composite implements TableListener, ClickListener table.setWidget(row + 1, 0, contextMenu); } - /*if (row < folderFileCount) { - - styleRow(selectedRow, false); - styleRow(row, true); - - previous = selectedRow; - selectedRow = row; - GSS.get().setCurrentSelection(files.get(selectedRow)); - if (previous >= 0) - table.setWidget(previous + 1, 0, images.document().createImage()); - table.setWidget(selectedRow + 1, 0, contextMenu); - } - */ } - public List getSelectedFiles() { - List result = new ArrayList(); + public List getSelectedFiles() { + List result = new ArrayList(); for (int i : selectedRows) result.add(files.get(i)); return result; @@ -473,7 +459,7 @@ public class FileList extends Composite implements TableListener, ClickListener */ void update() { int count = folderFileCount; - int max = startIndex + GSSService.VISIBLE_FILE_COUNT; + int max = startIndex + GSS.VISIBLE_FILE_COUNT; if (max > count) max = count; @@ -481,18 +467,18 @@ public class FileList extends Composite implements TableListener, ClickListener countLabel.setText("no files"); prevButton.setVisible(false); nextButton.setVisible(false); - } else if (folderFileCount < GSSService.VISIBLE_FILE_COUNT) { + } else if (folderFileCount < GSS.VISIBLE_FILE_COUNT) { countLabel.setText(folderFileCount + " files"); prevButton.setVisible(false); nextButton.setVisible(false); } else { countLabel.setText("" + (startIndex + 1) + " - " + max + " of " + count + " files"); prevButton.setVisible(startIndex != 0); - nextButton.setVisible(startIndex + GSSService.VISIBLE_FILE_COUNT < count); + nextButton.setVisible(startIndex + GSS.VISIBLE_FILE_COUNT < count); } // Show the selected files. int i = 1; - for (; i < GSSService.VISIBLE_FILE_COUNT + 1; ++i) { + for (; i < GSS.VISIBLE_FILE_COUNT + 1; ++i) { // Don't read past the end. // if (i > folderFileCount) // break; @@ -501,19 +487,20 @@ public class FileList extends Composite implements TableListener, ClickListener // Add a new row to the table, then set each of its columns to the // proper values. table.setWidget(i, 0, images.document().createImage()); - FileHeaderDTO fileHeader = files.get(startIndex + i - 1); + FileResource fileHeader = files.get(startIndex + i - 1); table.getRowFormatter().addStyleName(i, "gss-fileRow"); + table.setHTML(i, 1, fileHeader.getName()); - table.setText(i, 2, fileHeader.getOwner().getName()); + table.setText(i, 2, fileHeader.getOwner()); table.setText(i, 3, String.valueOf(fileHeader.getVersion())); table.setText(i, 4, String.valueOf(fileHeader.getFileSizeAsString())); final DateTimeFormat formatter = DateTimeFormat.getFormat("d/M/yyyy"); - table.setText(i, 5, formatter.format(fileHeader.getAuditInfo().getCreationDate())); + table.setText(i, 5, formatter.format(fileHeader.getCreationDate())); } // Clear any remaining slots. - for (; i < GSSService.VISIBLE_FILE_COUNT + 1; ++i) { + for (; i < GSS.VISIBLE_FILE_COUNT + 1; ++i) { table.setHTML(i, 0, " "); table.setHTML(i, 1, " "); table.setHTML(i, 2, " "); @@ -551,161 +538,157 @@ public class FileList extends Composite implements TableListener, ClickListener } } + public void updateFileCache(boolean updateSelectedFolder) { + if (!updateSelectedFolder && !GSS.get().getFolders().getTrashItem().equals(GSS.get().getFolders().getCurrent())) + updateFileCache(); + else if(GSS.get().getFolders().getCurrent() != null){ + final DnDTreeItem folderItem = (DnDTreeItem) GSS.get().getFolders().getCurrent(); + if (folderItem.getFolderResource() != null) { + + ExecuteGet gf = new ExecuteGet(FolderResource.class, folderItem.getFolderResource().getPath()) { + + public void onComplete() { + folderItem.setUserObject(getResult()); + updateFileCache(); + } + + @Override + public void onError(Throwable t) { + GWT.log("", t); + GSS.get().displayError("Unable to fetch folder " + folderItem.getFolderResource().getName()); + } + }; + DeferredCommand.addCommand(gf); + } + else if(folderItem.getTrashResource() != null){ + ExecuteGet gt = new ExecuteGet(TrashResource.class, folderItem.getTrashResource().getPath()){ + + public void onComplete() { + folderItem.setUserObject(getResult()); + updateFileCache(); + } + + + public void onError(Throwable t) { + if(t instanceof RestException && ((RestException)t).getHttpStatusCode() == 204){ + folderItem.setUserObject(new TrashResource(folderItem.getTrashResource().getPath())); + updateFileCache(); + } + else{ + GWT.log("", t); + GSS.get().displayError("Unable to fetch trash resource"); + } + } + }; + DeferredCommand.addCommand(gt); + } + } else + updateFileCache(); + } + /** * Update the file cache with data from the server. * * @param userId the ID of the current user */ - public void updateFileCache(final Long userId) { + private void updateFileCache() { + clearSelectedRows(); sortingProperty = "name"; sortingType = true; startIndex = 0; final TreeItem folderItem = GSS.get().getFolders().getCurrent(); // Validation. - if (folderItem == null){ - setFiles(new ArrayList()); + if (folderItem == null) { + setFiles(new ArrayList()); update(); return; } - GSS.get().showLoadingIndicator(); - if (GSS.get().getFolders().isTrash(folderItem)) - service.getDeletedFiles(userId, new AsyncCallback() { - - public void onSuccess(final Object result) { - final List f = (List) result; - setFiles(f); - GSS.get().hideLoadingIndicator(); - update(); - } - - public void onFailure(final Throwable caught) { - GWT.log("", caught); - GSS.get().hideLoadingIndicator(); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); - else - GSS.get().displayError(caught.getMessage()); - } - }); - else if (GSS.get().getFolders().isMyShares(folderItem)) - service.getSharedFiles(userId, new AsyncCallback() { - - public void onSuccess(final Object result) { - final List f = (List) result; - setFiles(f); - GSS.get().hideLoadingIndicator(); - update(); - } + if (folderItem instanceof DnDTreeItem) { + DnDTreeItem dnd = (DnDTreeItem) folderItem; + if (dnd.getFolderResource() != null) { + if (GSS.get().getFolders().isTrashItem(dnd)) + setFiles(new ArrayList()); + else + setFiles(dnd.getFolderResource().getFiles()); + + } else if (dnd.getTrashResource() != null) + setFiles(dnd.getTrashResource().getFiles()); + else if (dnd.getSharedResource() != null) + setFiles(dnd.getSharedResource().getFiles()); + else if (dnd.getOtherUserResource() != null) + setFiles(dnd.getOtherUserResource().getFiles()); + else + setFiles(dnd.getFolderResource().getFiles()); - public void onFailure(final Throwable caught) { - GWT.log("", caught); - GSS.get().hideLoadingIndicator(); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); - else - GSS.get().displayError(caught.getMessage()); - } - }); - else if (GSS.get().getFolders().isTrashItem(folderItem) || GSS.get().getFolders().isMyShares(folderItem) || GSS .get() - .getFolders() - .isOthersShared(folderItem)) { - setFiles(new ArrayList()); - GSS.get().hideLoadingIndicator(); update(); - } else if (GSS.get().getFolders().isFileItem(folderItem) || GSS.get().getFolders().isMySharedItem(folderItem)) { - final FolderDTO folder = (FolderDTO) folderItem.getUserObject(); - - service.getFiles(userId, folder.getId(), new AsyncCallback() { - - public void onSuccess(final Object result) { - final List f = (List) result; - if (!GSS.get().getFolders().isTrashItem(folderItem)) - setFiles(f); - GSS.get().hideLoadingIndicator(); - update(); - } + } + /* + String[] afiles = null; + if (dnd.getFolderResource() != null) { + if (!GSS.get().getFolders().isTrashItem(dnd)) + afiles = dnd.getFolderResource().getFilePaths().toArray(new String[] {}); + } else if (dnd.getTrashResource() != null) + afiles = dnd.getTrashResource().getFilePaths().toArray(new String[] {}); + else if (dnd.getSharedResource() != null) + afiles = dnd.getSharedResource().getRootSharedFiles().toArray(new String[] {}); + else if (dnd.getOtherUserResource() != null) + afiles = dnd.getOtherUserResource().getFilePaths().toArray(new String[] {}); + + if(afiles == null || afiles.length ==0){ + setFiles(new ArrayList()); + update(); + } + else{ + ExecuteMultipleHead gf = new ExecuteMultipleHead(FileResource.class, afiles){ - public void onFailure(final Throwable caught) { - GWT.log("", caught); - GSS.get().hideLoadingIndicator(); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); - else - GSS.get().displayError(caught.getMessage()); - } - }); - } else if (GSS.get().getFolders().isOthersSharedItem(folderItem)) { - if (folderItem.getUserObject() instanceof UserDTO) { - UserDTO owner = (UserDTO) folderItem.getUserObject(); - service.getSharedFiles(owner.getId(), userId, new AsyncCallback() { - - public void onSuccess(final Object result) { - final List f = (List) result; - setFiles(f); - GSS.get().hideLoadingIndicator(); + public void onComplete() { + setFiles(getResult()); update(); + debug(); } - public void onFailure(final Throwable caught) { - GWT.log("", caught); - GSS.get().hideLoadingIndicator(); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); - else - GSS.get().displayError(caught.getMessage()); - } - }); - } else { - FolderDTO folder = (FolderDTO) folderItem.getUserObject(); - UserDTO owner = (UserDTO) GSS.get().getFolders().getUserOfSharedItem(folderItem).getUserObject(); - // TODO: FETCH FILES THAT ARE PERMITTED - service.getFiles(owner.getId(), folder.getId(), new AsyncCallback() { - - public void onSuccess(final Object result) { - final List f = (List) result; - if (!GSS.get().getFolders().isTrashItem(folderItem)) - setFiles(f); - GSS.get().hideLoadingIndicator(); + + public void onError(Throwable t) { + GWT.log("", t); + GSS.get().displayError("Unable to fetch files"); + setFiles(new ArrayList()); update(); } - public void onFailure(final Throwable caught) { - GWT.log("", caught); - GSS.get().hideLoadingIndicator(); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); - else - GSS.get().displayError(caught.getMessage()); + + @Override + public void onError(String p, Throwable throwable) { + GWT.log("Path:"+p, throwable); } - }); + + + }; + DeferredCommand.addCommand(gf); } - } - else if (folderItem.getUserObject() == null) - GSS.get().hideLoadingIndicator(); - else - GSS.get().hideLoadingIndicator(); + }*/ + + } /** * Fill the file cache with data. * * @param _files - * @param files the files to set + * @param filePaths the files to set */ - void setFiles(final List _files) { + public void setFiles(final List _files) { files = _files; - Collections.sort(files, new Comparator() { + Collections.sort(files, new Comparator() { - public int compare(FileHeaderDTO arg0, FileHeaderDTO arg1) { + public int compare(FileResource arg0, FileResource arg1) { return arg0.getName().compareTo(arg1.getName()); } }); folderFileCount = files.size(); - GWT.log("File count:" + folderFileCount, null); } private void sortFiles(final String sortProperty) { @@ -717,24 +700,24 @@ public class FileList extends Composite implements TableListener, ClickListener } clearLabels(); clearSelectedRows(); - if(files == null || files.size()==0) + if (files == null || files.size() == 0) return; - Collections.sort(files, new Comparator() { + Collections.sort(files, new Comparator() { - public int compare(FileHeaderDTO arg0, FileHeaderDTO arg1) { + public int compare(FileResource arg0, FileResource arg1) { if (sortingType) if (sortProperty.equals("version")) { versionLabel.setHTML("Version " + images.desc().getHTML()); return new Integer(arg0.getVersion()).compareTo(new Integer(arg1.getVersion())); } else if (sortProperty.equals("owner")) { ownerLabel.setHTML("Owner " + images.desc().getHTML()); - return new Integer(arg0.getOwner().getName()).compareTo(new Integer(arg1.getOwner().getName())); + return new Integer(arg0.getOwner()).compareTo(new Integer(arg1.getOwner())); } else if (sortProperty.equals("date")) { dateLabel.setHTML("Date " + images.desc().getHTML()); - return arg0.getAuditInfo().getCreationDate().compareTo(arg1.getAuditInfo().getCreationDate()); + return arg0.getCreationDate().compareTo(arg1.getCreationDate()); } else if (sortProperty.equals("size")) { sizeLabel.setHTML("Size " + images.desc().getHTML()); - return new Long(arg0.getFileSize()).compareTo(new Long(arg1.getFileSize())); + return new Long(arg0.getContentLength()).compareTo(new Long(arg1.getContentLength())); } else if (sortProperty.equals("name")) { nameLabel.setHTML("Name " + images.desc().getHTML()); return arg0.getName().compareTo(arg1.getName()); @@ -745,17 +728,15 @@ public class FileList extends Composite implements TableListener, ClickListener else if (sortProperty.equals("version")) { versionLabel.setHTML("Version " + images.asc().getHTML()); return new Integer(arg1.getVersion()).compareTo(new Integer(arg0.getVersion())); - } - else if (sortProperty.equals("owner")) { + } else if (sortProperty.equals("owner")) { ownerLabel.setHTML("Owner " + images.asc().getHTML()); - return new Integer(arg1.getOwner().getName()).compareTo(new Integer(arg0.getOwner().getName())); - } - else if (sortProperty.equals("date")) { + return new Integer(arg1.getOwner()).compareTo(new Integer(arg0.getOwner())); + } else if (sortProperty.equals("date")) { dateLabel.setHTML("Date " + images.asc().getHTML()); - return arg1.getAuditInfo().getCreationDate().compareTo(arg0.getAuditInfo().getCreationDate()); + return arg1.getCreationDate().compareTo(arg0.getCreationDate()); } else if (sortProperty.equals("size")) { sizeLabel.setHTML("Size " + images.asc().getHTML()); - return new Long(arg1.getFileSize()).compareTo(new Long(arg0.getFileSize())); + return new Long(arg1.getContentLength()).compareTo(new Long(arg0.getContentLength())); } else if (sortProperty.equals("name")) { nameLabel.setHTML("Name " + images.asc().getHTML()); return arg1.getName().compareTo(arg0.getName()); @@ -806,7 +787,7 @@ public class FileList extends Composite implements TableListener, ClickListener } selectedRows.clear(); Object sel = GSS.get().getCurrentSelection(); - if (sel instanceof FileHeaderDTO || sel instanceof List) + if (sel instanceof FileResource || sel instanceof List) GSS.get().setCurrentSelection(null); } @@ -825,24 +806,24 @@ public class FileList extends Composite implements TableListener, ClickListener public void selectAllRows() { clearSelectedRows(); int count = folderFileCount; - if(count == 0) + if (count == 0) return; - int max = startIndex + GSSService.VISIBLE_FILE_COUNT; + int max = startIndex + GSS.VISIBLE_FILE_COUNT; if (max > count) max = count; int i = 1; - for (; i < GSSService.VISIBLE_FILE_COUNT + 1; ++i) { + for (; i < GSS.VISIBLE_FILE_COUNT + 1; ++i) { // Don't read past the end. // if (i > folderFileCount) // break; if (startIndex + i > folderFileCount) break; - selectedRows.add(startIndex + i-1); - styleRow(i-1, true); + selectedRows.add(startIndex + i - 1); + styleRow(i - 1, true); } GSS.get().setCurrentSelection(getSelectedFiles()); contextMenu.setFiles(getSelectedFiles()); - table.setWidget(i-1, 0, contextMenu); + table.setWidget(i - 1, 0, contextMenu); } diff --git a/gss/src/gr/ebs/gss/client/FileMenu.java b/gss/src/gr/ebs/gss/client/FileMenu.java index 2720df1..34fda2c 100644 --- a/gss/src/gr/ebs/gss/client/FileMenu.java +++ b/gss/src/gr/ebs/gss/client/FileMenu.java @@ -25,7 +25,10 @@ import gr.ebs.gss.client.commands.UpdateFileCommand; import gr.ebs.gss.client.commands.UploadFileCommand; import gr.ebs.gss.client.domain.FileHeaderDTO; import gr.ebs.gss.client.domain.UserDTO; +import gr.ebs.gss.client.rest.AbstractRestCommand; +import gr.ebs.gss.client.rest.resource.FileResource; +import com.google.gwt.http.client.URL; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.ui.AbstractImagePrototype; import com.google.gwt.user.client.ui.ClickListener; @@ -146,7 +149,7 @@ public class FileMenu extends PopupPanel implements ClickListener { */ void preDownloadCheck() { Object selection = GSS.get().getCurrentSelection(); - if (selection == null || !(selection instanceof FileHeaderDTO)) { + if (selection == null || !(selection instanceof FileResource)) { GSS.get().displayError("You have to select a file first"); return; } @@ -162,9 +165,12 @@ public class FileMenu extends PopupPanel implements ClickListener { */ void createDownloadLink(String[] link) { Object selection = GSS.get().getCurrentSelection(); - if (selection != null && selection instanceof FileHeaderDTO) { - FileHeaderDTO file = (FileHeaderDTO) selection; - link[0] = ""; + if (selection != null && selection instanceof FileResource) { + FileResource file = (FileResource) selection; + String dateString = AbstractRestCommand.getDate(); + String resource = file.getPath().substring(GSS.GSS_REST_PATH.length()-1,file.getPath().length()); + String sig = GSS.get().getCurrentUserResource().getUsername()+" "+AbstractRestCommand.calculateSig("GET", dateString, resource, AbstractRestCommand.base64decode(GSS.get().getToken())); + link[0] = ""; link[1] = ""; } } diff --git a/gss/src/gr/ebs/gss/client/FilePropertiesDialog.java b/gss/src/gr/ebs/gss/client/FilePropertiesDialog.java index 9c1de4d..b4aeec3 100644 --- a/gss/src/gr/ebs/gss/client/FilePropertiesDialog.java +++ b/gss/src/gr/ebs/gss/client/FilePropertiesDialog.java @@ -18,13 +18,15 @@ */ package gr.ebs.gss.client; -import gr.ebs.gss.client.domain.FileBodyDTO; -import gr.ebs.gss.client.domain.FileHeaderDTO; import gr.ebs.gss.client.domain.FolderDTO; -import gr.ebs.gss.client.domain.GroupDTO; -import gr.ebs.gss.client.domain.PermissionDTO; import gr.ebs.gss.client.domain.UserDTO; -import gr.ebs.gss.client.exceptions.RpcException; +import gr.ebs.gss.client.rest.ExecuteGet; +import gr.ebs.gss.client.rest.ExecutePost; +import gr.ebs.gss.client.rest.RestException; +import gr.ebs.gss.client.rest.resource.FileResource; +import gr.ebs.gss.client.rest.resource.GroupResource; +import gr.ebs.gss.client.rest.resource.PermissionHolder; +import gr.ebs.gss.client.rest.resource.TagsResource; import java.util.Iterator; import java.util.List; @@ -32,10 +34,13 @@ import java.util.Set; import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.DateTimeFormat; +import com.google.gwt.json.client.JSONArray; +import com.google.gwt.json.client.JSONBoolean; +import com.google.gwt.json.client.JSONObject; +import com.google.gwt.json.client.JSONString; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.Window; -import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.AbstractImagePrototype; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.CheckBox; @@ -106,6 +111,7 @@ public class FilePropertiesDialog extends DialogBox { private String initialTags; private final CheckBox versioned = new CheckBox(); + final FileResource file; /** * The widget's constructor. * @@ -114,12 +120,12 @@ public class FilePropertiesDialog extends DialogBox { * @param groups * @param bodies */ - public FilePropertiesDialog(final Images images, Set permissions, final List groups, List bodies) { + public FilePropertiesDialog(final Images images, final List groups, List bodies) { // Use this opportunity to set the dialog's caption. setText("File properties"); setAnimationEnabled(true); - final FileHeaderDTO file = (FileHeaderDTO) GSS.get().getCurrentSelection(); - permList = new PermissionsList(images, permissions, file.getOwner()); + file = (FileResource) GSS.get().getCurrentSelection(); + permList = new PermissionsList(images, file.getPermissions(), file.getOwner()); // Outer contains inner and buttons final VerticalPanel outer = new VerticalPanel(); @@ -157,9 +163,9 @@ public class FilePropertiesDialog extends DialogBox { UserDTO folder = (UserDTO) GSS.get().getFolders().getCurrent().getUserObject(); generalTable.setText(1, 1, folder.getName()); } - generalTable.setText(2, 1, file.getOwner().getName()); + generalTable.setText(2, 1, file.getOwner()); final DateTimeFormat formatter = DateTimeFormat.getFormat("d/M/yyyy h:mm a"); - generalTable.setText(3, 1, formatter.format(file.getAuditInfo().getCreationDate())); + generalTable.setText(3, 1, formatter.format(file.getCreationDate())); // Get the tags StringBuffer tagsBuffer = new StringBuffer(); Iterator i = file.getTags().iterator(); @@ -173,7 +179,7 @@ public class FilePropertiesDialog extends DialogBox { initialTags = tags.getText(); generalTable.setWidget(4, 1, tags); TextBox path = new TextBox(); - path.setText(file.getURI()); + path.setText(file.getPath()); path.setTitle("Use this URI for sharing this file with the world"); path.setReadOnly(true); generalTable.setWidget(5, 1, path); @@ -196,7 +202,7 @@ public class FilePropertiesDialog extends DialogBox { final Button ok = new Button("OK", new ClickListener() { public void onClick(Widget sender) { - accept(GSS.get().getCurrentUser().getId()); + accept(); hide(); } }); @@ -222,7 +228,7 @@ public class FilePropertiesDialog extends DialogBox { DeferredCommand.addCommand(new Command() { public void execute() { - updateTags(GSS.get().getCurrentUser().getId()); + updateTags(); } }); @@ -286,10 +292,9 @@ public class FilePropertiesDialog extends DialogBox { public void onClick(Widget sender) { //TODO: replace javascript confirmation dialog boolean confirm = Window.confirm("Really remove all previous versions?"); - if(confirm){ + if(confirm) hide(); - removeAllOldVersions(GSS.get().getCurrentUser().getId(), file.getId()); - } + removeAllOldVersions(); } @@ -314,14 +319,13 @@ public class FilePropertiesDialog extends DialogBox { * * @param userId */ - private void updateTags(Long userId) { - final GSSServiceAsync service = GSS.get().getRemoteService(); - service.getUserTags(userId, new AsyncCallback() { + private void updateTags() { + ExecuteGet tc = new ExecuteGet(TagsResource.class, GSS.get().getCurrentUserResource().getTagsPath()){ - public void onSuccess(final Object result) { - Set userTags = (Set) result; + public void onComplete() { allTagsContent.clear(); - + TagsResource tagr = getResult(); + List userTags = tagr.getTags(); Iterator t = userTags.iterator(); while (t.hasNext()) { final Button tag = new Button((String) t.next(), new ClickListener() { @@ -339,14 +343,14 @@ public class FilePropertiesDialog extends DialogBox { } } - public void onFailure(final Throwable caught) { - GWT.log("", caught); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); - else - GSS.get().displayError(caught.getMessage()); + @Override + public void onError(Throwable t) { + GWT.log("", t); + GSS.get().displayError("Unable to fetch user tags"); } - }); + }; + DeferredCommand.addCommand(tc); + } @Override @@ -356,7 +360,7 @@ public class FilePropertiesDialog extends DialogBox { // enter or escape is pressed. switch (key) { case KeyboardListener.KEY_ENTER: - accept(GSS.get().getCurrentUser().getId()); + accept(); case KeyboardListener.KEY_ESCAPE: hide(); break; @@ -370,94 +374,104 @@ public class FilePropertiesDialog extends DialogBox { * * @param userId */ - private void accept(final Long userId) { - - final GSSServiceAsync service = GSS.get().getRemoteService(); - final FileHeaderDTO file = (FileHeaderDTO) GSS.get().getCurrentSelection(); - if(file.isVersioned() != versioned.isChecked()) - toggleVersioned(GSS.get().getCurrentUser().getId(), file.getId(), versioned.isChecked()); - if (name.getText().equals(file.getName()) && tags.getText().equals(initialTags)) { - GWT.log("no changes in name or tags", null); - updatePermissions(); - return; - } - service.updateFile(userId, file.getId(), name.getText(), tags.getText(), new AsyncCallback() { - - public void onSuccess(final Object result) { - updatePermissions(); - GSS.get().getFileList().updateFileCache(userId); - GWT.log("File " + file.getId() + " update successful", null); - } - - public void onFailure(final Throwable caught) { - GWT.log("", caught); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); - else - GSS.get().displayError(caught.getMessage()); - } - }); - - } - - private void updatePermissions() { + private void accept() { permList.updatePermissionsAccordingToInput(); - final FileHeaderDTO file = (FileHeaderDTO) GSS.get().getCurrentSelection(); - if (!permList.hasChanges() && readForAll.isChecked() == file.isReadForAll()) { - GWT.log("no changes in permissions", null); - return; + Set perms = permList.getPermissions(); + JSONObject json = new JSONObject(); + json.put("name", new JSONString(name.getText())); + json.put("versioned", JSONBoolean.getInstance(versioned.isChecked())); + json.put("readForAll", JSONBoolean.getInstance(readForAll.isChecked())); + JSONArray perma = new JSONArray(); + int i=0; + for(PermissionHolder p : perms){ + JSONObject po = new JSONObject(); + if(p.getUser() != null) + po.put("user", new JSONString(p.getUser())); + if(p.getGroup() != null) + po.put("group", new JSONString(p.getGroup())); + po.put("read", JSONBoolean.getInstance(p.isRead())); + po.put("write", JSONBoolean.getInstance(p.isWrite())); + po.put("modifyACL", JSONBoolean.getInstance(p.isModifyACL())); + perma.set(i,po); + i++; } - final GSSServiceAsync service = GSS.get().getRemoteService(); - service.setFilePermissions(GSS.get().getCurrentUser().getId(), ((FileHeaderDTO) GSS.get().getCurrentSelection()).getId(), readForAll.isChecked(), permList.permissions, new AsyncCallback() { - - public void onSuccess(final Object result) { - GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId()); + json.put("permissions", perma); + JSONArray taga = new JSONArray(); + i=0; + String[] tagset = tags.getText().split(","); + for(String t : tagset){ + JSONString to = new JSONString(t); + taga.set(i,to); + i++; + } + json.put("tags", taga); + GWT.log(json.toString(), null); + ExecutePost cf = new ExecutePost(file.getPath()+"?update=",json.toString(), 200){ + public void onComplete() { + GSS.get().getFileList().updateFileCache(true); } - public void onFailure(final Throwable caught) { - GWT.log("", caught); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); + + public void onError(Throwable t) { + GWT.log("", t); + if(t instanceof RestException){ + int statusCode = ((RestException)t).getHttpStatusCode(); + if(statusCode == 405) + GSS.get().displayError("You don't have the necessary permissions"); + else if(statusCode == 404) + GSS.get().displayError("User in permissions does not exist"); + else if(statusCode == 409) + GSS.get().displayError("A file with the same name already exists"); + else if(statusCode == 413) + GSS.get().displayError("Your quota has been exceeded"); + else + GSS.get().displayError("Unable to modify file, status code:"+statusCode); + } else - GSS.get().displayError(caught.getMessage()); + GSS.get().displayError("System error modifying file:"+t.getMessage()); } - }); - } - private void removeAllOldVersions(Long userId, Long fileId) { - GSS.get().getRemoteService().removeOldVersions(userId, fileId, new AsyncCallback(){ + }; + DeferredCommand.addCommand(cf); - public void onFailure(Throwable caught) { - // GWT.log("", caught); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); - else - GSS.get().displayError(caught.getMessage()); - } + } - public void onSuccess(Object result) { - GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId()); - } - }); + private void removeAllOldVersions() { + toggleVersioned(false); + toggleVersioned(true); } - private void toggleVersioned(Long userId, Long fileId, boolean version){ - GSS.get().getRemoteService().toggleFileVersioning(userId, fileId, version, new AsyncCallback(){ - - public void onFailure(Throwable caught) { - // GWT.log("", caught); - if (caught instanceof RpcException) - GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage()); - else - GSS.get().displayError(caught.getMessage()); + private void toggleVersioned(boolean versionedValue){ + JSONObject json = new JSONObject(); + json.put("versioned", JSONBoolean.getInstance(versionedValue)); + GWT.log(json.toString(), null); + ExecutePost cf = new ExecutePost(file.getPath()+"?update=",json.toString(), 200){ + public void onComplete() { + GSS.get().getFileList().updateFileCache(true); } - public void onSuccess(Object result) { - GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId()); + public void onError(Throwable t) { + GWT.log("", t); + if(t instanceof RestException){ + int statusCode = ((RestException)t).getHttpStatusCode(); + if(statusCode == 405) + GSS.get().displayError("You don't have the necessary permissions"); + else if(statusCode == 404) + GSS.get().displayError("User in permissions does not exist"); + else if(statusCode == 409) + GSS.get().displayError("A folder with the same name already exists"); + else if(statusCode == 413) + GSS.get().displayError("Your quota has been exceeded"); + else + GSS.get().displayError("Unable to modify file, status code:"+statusCode); + } + else + GSS.get().displayError("System error moifying file:"+t.getMessage()); } - - }); + }; + DeferredCommand.addCommand(cf); } + } diff --git a/gss/src/gr/ebs/gss/client/FileUpdateDialog.java b/gss/src/gr/ebs/gss/client/FileUpdateDialog.java index e483eac..a3b2708 100644 --- a/gss/src/gr/ebs/gss/client/FileUpdateDialog.java +++ b/gss/src/gr/ebs/gss/client/FileUpdateDialog.java @@ -18,13 +18,15 @@ */ package gr.ebs.gss.client; -import gr.ebs.gss.client.domain.FileHeaderDTO; -import gr.ebs.gss.client.domain.FolderDTO; -import gr.ebs.gss.client.domain.UploadStatusDTO; +import gr.ebs.gss.client.rest.AbstractRestCommand; +import gr.ebs.gss.client.rest.ExecuteGet; +import gr.ebs.gss.client.rest.resource.FileResource; +import gr.ebs.gss.client.rest.resource.FolderResource; +import gr.ebs.gss.client.rest.resource.UploadStatusResource; import com.google.gwt.core.client.GWT; +import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.Timer; -import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.DialogBox; @@ -46,10 +48,6 @@ import com.google.gwt.user.client.ui.Widget; */ public class FileUpdateDialog extends DialogBox implements Updateable { - /** - * The path info portion of the URL that provides the file upload service. - */ - private static final String FILE_UPLOAD_PATH = "/gss/fileUpload"; private int prgBarInterval = 1500; @@ -63,6 +61,8 @@ public class FileUpdateDialog extends DialogBox implements Updateable { final FormPanel form = new FormPanel(); private String fileName; + + final FileResource selectedFile; /** * The widget's constructor. */ @@ -70,9 +70,14 @@ public class FileUpdateDialog extends DialogBox implements Updateable { // Use this opportunity to set the dialog's caption. setText("File upload"); setAnimationEnabled(true); - form.setAction(FILE_UPLOAD_PATH); + + final Object selection = GSS.get().getFolders().getCurrent().getUserObject(); + final FolderResource folder = (FolderResource) selection; + + selectedFile = (FileResource) GSS.get().getCurrentSelection(); // Because we're going to add a FileUpload widget, we'll need to set the // form to use the POST method, and multipart MIME encoding. + form.setAction(selectedFile.getPath()); form.setEncoding(FormPanel.ENCODING_MULTIPART); form.setMethod(FormPanel.METHOD_POST); @@ -81,18 +86,13 @@ public class FileUpdateDialog extends DialogBox implements Updateable { form.setWidget(panel); // Add an informative label with the folder name. - final Object selection = GSS.get().getFolders().getCurrent().getUserObject(); - final FolderDTO folder = (FolderDTO) selection; - - FileHeaderDTO selectedFile = (FileHeaderDTO) GSS.get().getCurrentSelection(); - // Add the folder ID in a hidden field. - final Hidden folderId = new Hidden("folderId", folder.getId().toString()); - panel.add(folderId); - final Hidden userId = new Hidden("userId", GSS.get().getCurrentUser().getId().toString()); - panel.add(userId); - - final Hidden fileHeaderId = new Hidden("fileHeaderId", selectedFile.getId().toString()); - panel.add(fileHeaderId); + String dateString = AbstractRestCommand.getDate(); + String resource = selectedFile.getPath().substring(GSS.GSS_REST_PATH.length()-1,selectedFile.getPath().length()); + String sig = AbstractRestCommand.calculateSig("POST", dateString, resource, AbstractRestCommand.base64decode(GSS.get().getToken())); + final Hidden date = new Hidden("Date", dateString); + panel.add(date); + final Hidden auth = new Hidden("Authorization", GSS.get().getCurrentUserResource().getUsername()+" "+sig); + panel.add(auth); // Create a FileUpload widget. final FileUpload upload = new FileUpload(); @@ -178,7 +178,7 @@ public class FileUpdateDialog extends DialogBox implements Updateable { } repeater.finish(); hide(); - GSS.get().showFileList(); + GSS.get().showFileList(true); GSS.get().getStatusPanel().updateStats(); } }); @@ -260,21 +260,24 @@ public class FileUpdateDialog extends DialogBox implements Updateable { * @see gr.ebs.gss.client.Updateable#update() */ public void update() { - final GSSServiceAsync service = GSS.get().getRemoteService(); - service.getUploadStatus(GSS.get().getCurrentUser().getId(), fileName, new AsyncCallback() { + String apath = selectedFile.getPath(); + apath = apath+"?progress="+fileName; + ExecuteGet eg = new ExecuteGet(UploadStatusResource.class,apath){ - public void onFailure(Throwable arg0) { + public void onComplete() { + UploadStatusResource res = getResult(); + progressBar.setProgress(res.percent()); } - public void onSuccess(Object arg0) { - UploadStatusDTO res = (UploadStatusDTO) arg0; - if (res != null) - progressBar.setProgress(res.percent()); - + public void onError(Throwable t) { + GWT.log("", t); + progressBar.setProgress(100); } - }); + }; + DeferredCommand.addCommand(eg); + } diff --git a/gss/src/gr/ebs/gss/client/FileUploadDialog.java b/gss/src/gr/ebs/gss/client/FileUploadDialog.java index ffd064c..6b157ab 100644 --- a/gss/src/gr/ebs/gss/client/FileUploadDialog.java +++ b/gss/src/gr/ebs/gss/client/FileUploadDialog.java @@ -18,15 +18,18 @@ */ package gr.ebs.gss.client; -import gr.ebs.gss.client.domain.FileHeaderDTO; -import gr.ebs.gss.client.domain.FolderDTO; -import gr.ebs.gss.client.domain.UploadStatusDTO; +import gr.ebs.gss.client.rest.AbstractRestCommand; +import gr.ebs.gss.client.rest.ExecuteGet; +import gr.ebs.gss.client.rest.resource.FileResource; +import gr.ebs.gss.client.rest.resource.FolderResource; +import gr.ebs.gss.client.rest.resource.UploadStatusResource; import java.util.List; import com.google.gwt.core.client.GWT; +import com.google.gwt.http.client.URL; +import com.google.gwt.user.client.DeferredCommand; import com.google.gwt.user.client.Timer; -import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.DialogBox; @@ -56,13 +59,6 @@ public class FileUploadDialog extends DialogBox implements Updateable { public static final boolean DONE = true; - - - /** - * The path info portion of the URL that provides the file upload service. - */ - private static final String FILE_UPLOAD_PATH = "/gss/fileUpload"; - /** * The Form element that performs the file upload. */ @@ -70,43 +66,39 @@ public class FileUploadDialog extends DialogBox implements Updateable { final FileUpload upload = new FileUpload(); - private List files; + private List files; boolean cancelEvent = false; private String fileNameToUse; + final FolderResource folder; /** * The widget's constructor. * @param _files */ - public FileUploadDialog(List _files) { + public FileUploadDialog(List _files) { files = _files; // Use this opportunity to set the dialog's caption. setText("File upload"); setAnimationEnabled(true); - form.setAction(FILE_UPLOAD_PATH); + //form.setAction(FILE_UPLOAD_PATH); // Because we're going to add a FileUpload widget, we'll need to set the // form to use the POST method, and multipart MIME encoding. form.setEncoding(FormPanel.ENCODING_MULTIPART); form.setMethod(FormPanel.METHOD_POST); + // Create a panel to hold all of the form widgets. final VerticalPanel panel = new VerticalPanel(); form.setWidget(panel); - + final Hidden date = new Hidden("Date", ""); + panel.add(date); + final Hidden auth = new Hidden("Authorization", ""); + panel.add(auth); // Add an informative label with the folder name. final Object selection = GSS.get().getFolders().getCurrent().getUserObject(); - final FolderDTO folder = (FolderDTO) selection; - - // Add the folder ID in a hidden field. - final Hidden folderId = new Hidden("folderId", folder.getId().toString()); - panel.add(folderId); - final Hidden userId = new Hidden("userId", GSS.get().getCurrentUser().getId().toString()); - panel.add(userId); - // Create a FileUpload widget. - + folder = (FolderResource) selection; upload.setName("file"); - final Grid generalTable = new Grid(2, 2); generalTable.setText(0, 0, "Folder"); generalTable.setText(1, 0, "File"); @@ -152,6 +144,7 @@ public class FileUploadDialog extends DialogBox implements Updateable { form.addFormHandler(new FormHandler() { public void onSubmit(final FormSubmitEvent event) { + // This event is fired just before the form is submitted. We can // take this opportunity to perform validation. if (upload.getFilename().length() == 0) { @@ -160,6 +153,7 @@ public class FileUploadDialog extends DialogBox implements Updateable { hide(); } else { + canContinue(); GWT.log("Cancel:" + cancelEvent, null); if (cancelEvent) { @@ -169,6 +163,18 @@ public class FileUploadDialog extends DialogBox implements Updateable { hide(); } else{ fileNameToUse = getFilename(upload.getFilename()); + String apath = folder.getPath(); + if(!apath.endsWith("/")) + apath = apath+"/"; + apath = apath+URL.encodeComponent(fileNameToUse); + + form.setAction(apath); + String dateString = AbstractRestCommand.getDate(); + String resource = apath.substring(GSS.GSS_REST_PATH.length()-1, apath.length()); + String sig = AbstractRestCommand.calculateSig("POST", dateString, resource, AbstractRestCommand.base64decode(GSS.get().getToken())); + date.setValue(dateString); + auth.setValue(GSS.get().getCurrentUserResource().getUsername()+" "+sig); + GWT.log("FolderPATH:"+folder.getPath(), null); submit.setEnabled(false); repeater.start(); progressBar.setVisible(true); @@ -182,16 +188,17 @@ public class FileUploadDialog extends DialogBox implements Updateable { // of type text/html, we can get the result text here (see // the FormPanel documentation for further explanation). final String results = event.getResults(); + // Unfortunately the results are never empty, even in // the absense of errors, so we have to check for '
'.
 				if (!results.equalsIgnoreCase("
")) {
 					GWT.log(results, null);
 					GSS.get().displayError(results);
 				}
+				progressBar.setProgress(100);
 				repeater.finish();
-
 				hide();
-				GSS.get().showFileList();
+				GSS.get().showFileList(true);
 				GSS.get().getStatusPanel().updateStats();
 			}
 		});
@@ -248,20 +255,23 @@ public class FileUploadDialog extends DialogBox implements Updateable {
 			return false;
 		String fileName = getFilename(upload.getFilename());
 		GWT.log("filename to upload:" + fileName, null);
-		for (FileHeaderDTO dto : files) {
+		for (FileResource dto : files) {
 			GWT.log("Check:" + dto.getName() + "/" + fileName, null);
 			if (dto.getName().equals(fileName)) {
 				cancelEvent = true;
 				return true;
 			}
 		}
+		/*
 		Object selection = GSS.get().getFolders().getCurrent().getUserObject();
-		FolderDTO folder = (FolderDTO) selection;
-		for (FolderDTO dto : folder.getSubfolders())
+
+		FolderResource folder = (FolderResource) selection;
+		for (FolderResource dto : folder.get())
 			if (dto.getName().equals(fileName)) {
 				cancelEvent = true;
 				return true;
 			}
+			*/
 		return true;
 	}
 
@@ -313,20 +323,26 @@ public class FileUploadDialog extends DialogBox implements Updateable {
 	 * @see gr.ebs.gss.client.Updateable#update()
 	 */
 	public void update() {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		service.getUploadStatus(GSS.get().getCurrentUser().getId(), fileNameToUse ,new AsyncCallback(){
+		String apath = folder.getPath();
+		if(!apath.endsWith("/"))
+			apath =  apath+"/";
+		apath = apath+URL.encodeComponent(fileNameToUse)+"?progress="+fileNameToUse;
+		ExecuteGet eg = new ExecuteGet(UploadStatusResource.class,apath){
+
 
-			public void onFailure(Throwable t) {
-				GSS.get().displayError(t.getMessage());
+			public void onComplete() {
+				UploadStatusResource res = getResult();
+				progressBar.setProgress(res.percent());
 			}
 
-			public void onSuccess(Object status) {
-				UploadStatusDTO res = (UploadStatusDTO)status;
-				if(res != null)
-					progressBar.setProgress(res.percent());
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				progressBar.setProgress(100);
 			}
 
-		});
+		};
+		DeferredCommand.addCommand(eg);
+
 
 	}
 }
diff --git a/gss/src/gr/ebs/gss/client/FolderContextMenu.java b/gss/src/gr/ebs/gss/client/FolderContextMenu.java
index 7727333..6cd974e 100644
--- a/gss/src/gr/ebs/gss/client/FolderContextMenu.java
+++ b/gss/src/gr/ebs/gss/client/FolderContextMenu.java
@@ -28,8 +28,7 @@ import gr.ebs.gss.client.commands.PropertiesCommand;
 import gr.ebs.gss.client.commands.RestoreTrashCommand;
 import gr.ebs.gss.client.commands.ToTrashCommand;
 import gr.ebs.gss.client.commands.UploadFileCommand;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.UserDTO;
+import gr.ebs.gss.client.rest.resource.OtherUserResource;
 
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.Window;
@@ -84,15 +83,27 @@ public class FolderContextMenu extends PopupPanel {
 		if(selectedItem != null)
 			if(folders.isTrashItem(selectedItem)){
 				boolean notTrashRootFolder = !folders.isTrash(selectedItem);
-				contextMenu.addItem("" + newImages.viewText().getHTML() + " Restore All Trashed Items", true, new RestoreTrashCommand(this)).setVisible(!notTrashRootFolder);
 				contextMenu.addItem("" + newImages.delete().getHTML() + " Empty Trash", true, new EmptyTrashCommand(this)).setVisible(!notTrashRootFolder);
 				//'Restore'/'Delete' not in Trash root
 				contextMenu.addItem("" + newImages.viewText().getHTML() + " Restore folder and contents", true, new RestoreTrashCommand(this)).setVisible(notTrashRootFolder);
 				contextMenu.addItem("" + newImages.delete().getHTML() + " Delete", true, new DeleteCommand(this, newImages)).setVisible(notTrashRootFolder);
 			}
+			/*
+			else if(((DnDTreeItem)selectedItem).getFolderResource()!=null){
+				contextMenu.addItem("" + newImages.folderNew().getHTML() + " New Folder", true, new NewFolderCommand(this, images));
+				contextMenu.addItem("" + newImages.fileNew().getHTML() + " New File", true, new UploadFileCommand(this));
+				// do not show the copy & cut option for the user's root folder
+				contextMenu.addItem("" + newImages.cut().getHTML() + " Cut", true, new CutCommand(this));
+				contextMenu.addItem("" + newImages.copy().getHTML() + " Copy", true, new CopyCommand(this));
+				contextMenu.addItem(pasteItem);
+				// do not show delete options for the user's root folder
+				contextMenu.addItem("" + newImages.emptyTrash().getHTML() + " Move to Trash", true, new ToTrashCommand(this));
+				contextMenu.addItem("" + newImages.delete().getHTML() + " Delete", true, new DeleteCommand(this, newImages));
+				contextMenu.addItem("" + newImages.viewText().getHTML() + " Properties", true, new PropertiesCommand(this, newImages));
+			}*/
 			else if(folders.isFileItem(selectedItem)){
-				final FolderDTO selectedFolder = (FolderDTO) GSS.get().getCurrentSelection();
-				boolean notRootFolder = selectedFolder != null && selectedFolder.getParent() != null;
+
+				boolean notRootFolder = !folders.getRootItem().equals(selectedItem);
 				contextMenu.addItem("" + newImages.folderNew().getHTML() + " New Folder", true, new NewFolderCommand(this, images));
 				contextMenu.addItem("" + newImages.fileNew().getHTML() + " New File", true, new UploadFileCommand(this));
 				// do not show the copy & cut option for the user's root folder
@@ -116,7 +127,7 @@ public class FolderContextMenu extends PopupPanel {
 				contextMenu.addItem("" + newImages.delete().getHTML() + " Delete", true, new DeleteCommand(this, newImages));
 				contextMenu.addItem("" + newImages.viewText().getHTML() + " Properties", true, new PropertiesCommand(this, newImages));
 			}
-			else if(!folders.isOthersShared(selectedItem) && folders.isOthersSharedItem(selectedItem) && !(GSS.get().getCurrentSelection() instanceof UserDTO)){
+			else if(!folders.isOthersShared(selectedItem) && folders.isOthersSharedItem(selectedItem) && !(GSS.get().getCurrentSelection() instanceof OtherUserResource)){
 				contextMenu.addItem("" + newImages.folderNew().getHTML() + " New Folder", true, new NewFolderCommand(this, images));
 				contextMenu.addItem("" + newImages.fileNew().getHTML() + " New File", true, new UploadFileCommand(this));
 				// do not show the copy & cut option for the user's root folder
diff --git a/gss/src/gr/ebs/gss/client/FolderPropertiesDialog.java b/gss/src/gr/ebs/gss/client/FolderPropertiesDialog.java
index c27f5ba..3bf2fab 100644
--- a/gss/src/gr/ebs/gss/client/FolderPropertiesDialog.java
+++ b/gss/src/gr/ebs/gss/client/FolderPropertiesDialog.java
@@ -19,18 +19,23 @@
 package gr.ebs.gss.client;
 
 import gr.ebs.gss.client.FilePropertiesDialog.Images;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.PermissionDTO;
-import gr.ebs.gss.client.exceptions.DuplicateNameException;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.dnd.DnDTreeItem;
+import gr.ebs.gss.client.rest.ExecutePost;
+import gr.ebs.gss.client.rest.RestException;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.GroupResource;
+import gr.ebs.gss.client.rest.resource.PermissionHolder;
 
 import java.util.List;
 import java.util.Set;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONBoolean;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONString;
+import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.ClickListener;
 import com.google.gwt.user.client.ui.DialogBox;
@@ -40,7 +45,6 @@ import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.KeyboardListener;
 import com.google.gwt.user.client.ui.TabPanel;
 import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.TreeItem;
 import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
 
@@ -49,9 +53,9 @@ import com.google.gwt.user.client.ui.Widget;
  */
 public class FolderPropertiesDialog extends DialogBox {
 
-	Set permissions = null;
 
-	private List groups = null;
+
+	private List groups = null;
 
 	final PermissionsList permList;
 
@@ -66,6 +70,7 @@ public class FolderPropertiesDialog extends DialogBox {
 	 */
 	private final boolean create;
 
+	final FolderResource folder;
 	/**
 	 * The widget's constructor.
 	 *
@@ -74,13 +79,13 @@ public class FolderPropertiesDialog extends DialogBox {
 	 *            sub-folder of the selected folder, false if it is displayed
 	 *            for modifying the selected folder
 	 */
-	public FolderPropertiesDialog(final Images images, final boolean _create, Set permissions, final List groups) {
+	public FolderPropertiesDialog(final Images images, final boolean _create,  final List groups) {
 		setAnimationEnabled(true);
 
 		create = _create;
-		final FolderDTO folder = (FolderDTO) GSS.get().getFolders().getCurrent().getUserObject();
-		permList = new PermissionsList(images, permissions, folder.getOwner());
-		this.permissions = permissions;
+		//final FolderDTO folder = (FolderDTO) GSS.get().getFolders().getCurrent().getUserObject();
+		folder = ((DnDTreeItem)GSS.get().getFolders().getCurrent()).getFolderResource();
+		permList = new PermissionsList(images, folder.getPermissions(), folder.getOwner());
 		this.groups = groups;
 		// Use this opportunity to set the dialog's caption.
 		if (create)
@@ -110,11 +115,12 @@ public class FolderPropertiesDialog extends DialogBox {
 		generalTable.setWidget(0, 1, folderName);
 		if (create)
 			generalTable.setText(1, 1, folder.getName());
-		else
-			generalTable.setText(1, 1, folder.getParent() == null ? "-" : folder.getParent().getName());
-		generalTable.setText(2, 1, folder.getOwner().getName());
+		//else
+			//generalTable.setText(1, 1, folder.getParent() == null ? "-" : folder.getParent().getName());
+		generalTable.setText(2, 1, folder.getOwner());
 		final DateTimeFormat formatter = DateTimeFormat.getFormat("d/M/yyyy h:mm a");
-		generalTable.setText(3, 1, formatter.format(folder.getAuditInfo().getCreationDate()));
+		if(folder.getCreationDate() != null)
+			generalTable.setText(3, 1, formatter.format(folder.getCreationDate()));
 		generalTable.getFlexCellFormatter().setStyleName(0, 0, "props-labels");
 		generalTable.getFlexCellFormatter().setStyleName(1, 0, "props-labels");
 		generalTable.getFlexCellFormatter().setStyleName(2, 0, "props-labels");
@@ -131,7 +137,7 @@ public class FolderPropertiesDialog extends DialogBox {
 
 			public void onClick(Widget sender) {
 
-				createOrUpdateFolder(GSS.get().getCurrentUser().getId());
+				createOrUpdateFolder();
 
 				hide();
 			}
@@ -199,39 +205,7 @@ public class FolderPropertiesDialog extends DialogBox {
 		folderName.setFocus(true);
 	}
 
-	/**
-	 * Generate an RPC request to modify a folder.
-	 *
-	 * @param userId the ID of the current user
-	 */
-	private void modifyFolder(final Long userId) {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		final TreeItem folder = GSS.get().getFolders().getCurrent();
-		if (folder == null) {
-			GSS.get().displayError("No folder was selected!");
-			return;
-		}
-		final Long folderId = ((FolderDTO) folder.getUserObject()).getId();
-		GWT.log("modifyFolder(" + userId + "," + folderId + ")", null);
-		//update only if folder name is changed
-		if (!((FolderDTO) folder.getUserObject()).getName().equals(folderName.getText()))
-			service.modifyFolder(userId, folderId, folderName.getText(), new AsyncCallback() {
-
-				public void onSuccess(final Object result) {
-					GSS.get().getFolders().onFolderUpdate(folder);
-				}
 
-				public void onFailure(final Throwable caught) {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-					else
-						GSS.get().displayError(caught.getMessage());
-				}
-			});
-		else
-			GWT.log("no changes in name", null);
-	}
 
 	/*
 	 * (non-Javadoc)
@@ -244,7 +218,7 @@ public class FolderPropertiesDialog extends DialogBox {
 		switch (key) {
 			case KeyboardListener.KEY_ENTER:
 				hide();
-				createOrUpdateFolder(GSS.get().getCurrentUser().getId());
+				createOrUpdateFolder();
 				break;
 			case KeyboardListener.KEY_ESCAPE:
 				hide();
@@ -261,39 +235,30 @@ public class FolderPropertiesDialog extends DialogBox {
 	 *            folders
 	 * @param _folderName the name of the folder to create
 	 */
-	private void createFolder(final Long userId) {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		final TreeItem selectedParentItem = GSS.get().getFolders().getCurrent();
-		if (selectedParentItem == null) {
-			GSS.get().displayError("No parent was selected!");
-			return;
-		}
-		final FolderDTO selectedParent = (FolderDTO) selectedParentItem.getUserObject();
-		final Long parentId = selectedParent.getId();
-		final String _folderName = folderName.getText();
-		if (_folderName == null || _folderName.length() == 0) {
-			GSS.get().displayError("Empty folder name!");
-			return;
-		}
-		GWT.log("createFolder(" + userId + "," + parentId + "," + _folderName + ")", null);
-		service.createFolder(userId, parentId, _folderName, new AsyncCallback() {
+	private void createFolder() {
+		ExecutePost ep = new ExecutePost(folder.getPath()+"?new="+folderName.getText(),"", 201){
 
-			public void onSuccess(final Object result) {
-				GSS.get().getFolders().update(GSS.get().getCurrentUser().getId(), selectedParentItem);
+			public void onComplete() {
+				GSS.get().getFolders().updateFolder( (DnDTreeItem) GSS.get().getFolders().getCurrent());
 			}
 
-			public void onFailure(final Throwable caught) {
-				if (caught instanceof DuplicateNameException)
-					GSS.get().displayError(caught.getMessage());
-				else {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				if(t instanceof RestException){
+					int statusCode = ((RestException)t).getHttpStatusCode();
+					if(statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions or a folder with same name already exists");
+					else if(statusCode == 404)
+						GSS.get().displayError("Resource not found");
 					else
-						GSS.get().displayError(caught.getMessage());
+						GSS.get().displayError("Unable to create folder, status code:"+statusCode+ " "+t.getMessage());
 				}
+				else
+					GSS.get().displayError("System error creating folder:"+t.getMessage());
 			}
-		});
+		};
+		DeferredCommand.addCommand(ep);
+
 	}
 
 	/**
@@ -303,39 +268,71 @@ public class FolderPropertiesDialog extends DialogBox {
 	 *
 	 * @param userId
 	 */
-	private void createOrUpdateFolder(final Long userId) {
+	private void createOrUpdateFolder() {
 		if (create)
-			createFolder(userId);
-		else {
-			permList.updatePermissionsAccordingToInput();
-			if(permList.hasChanges())
-				updatePermissions();
-			else{
-				GWT.log("no changes in permissions", null);
-				modifyFolder(userId);
-			}
-		}
-	}
+			createFolder();
+		else
+			updateFolder();
 
-	private void updatePermissions() {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		service.setFolderPermissions(GSS.get().getCurrentUser().getId(), ((FolderDTO) GSS.get().getCurrentSelection()).getId(), permList.permissions, new AsyncCallback() {
+	}
 
-			public void onSuccess(final Object result) {
-				GSS.get().getFolders().update(GSS.get().getCurrentUser().getId(), GSS.get().getFolders().getMySharesItem());
-				modifyFolder(GSS.get().getCurrentUser().getId());
+	private void updateFolder() {
+		permList.updatePermissionsAccordingToInput();
+		Set perms = permList.getPermissions();
+		JSONObject json = new JSONObject();
+		if(!folder.getName().equals(folderName.getText()))
+			json.put("name", new JSONString(folderName.getText()));
+		JSONArray perma = new JSONArray();
+		int i=0;
+		for(PermissionHolder p : perms){
+			JSONObject po = new JSONObject();
+			if(p.getUser() != null)
+				po.put("user", new JSONString(p.getUser()));
+			if(p.getGroup() != null)
+				po.put("group", new JSONString(p.getGroup()));
+			po.put("read", JSONBoolean.getInstance(p.isRead()));
+			po.put("write", JSONBoolean.getInstance(p.isWrite()));
+			po.put("modifyACL", JSONBoolean.getInstance(p.isModifyACL()));
+			perma.set(i,po);
+			i++;
+		}
+		json.put("permissions", perma);
+		GWT.log(json.toString(), null);
+		ExecutePost ep = new ExecutePost(folder.getPath()+"?update=", json.toString(), 200){
+
+
+			public void onComplete() {
+				if(getPostBody() != null && !"".equals(getPostBody())){
+					DnDTreeItem folderItem = (DnDTreeItem) GSS.get().getFolders().getCurrent();
+					FolderResource fres = folderItem.getFolderResource();
+					String initialPath = fres.getPath();
+					fres.setPath(getPostBody());
+					if(((DnDTreeItem)folderItem.getParentItem()).getFolderResource() != null){
+						((DnDTreeItem)folderItem.getParentItem()).getFolderResource().removeSubfolderPath(initialPath);
+						((DnDTreeItem)folderItem.getParentItem()).getFolderResource().getSubfolderPaths().add(getPostBody());
+					}
+				}
+				GSS.get().getFolders().updateFolder( (DnDTreeItem) GSS.get().getFolders().getCurrent());
 			}
 
-			public void onFailure(final Throwable caught) {
-
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				if(t instanceof RestException){
+					int statusCode = ((RestException)t).getHttpStatusCode();
+					if(statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions or a folder with same name already exists");
+					else if(statusCode == 404)
+						GSS.get().displayError("Resource not found, or user used in permissions does not exist");
+					else
+						GSS.get().displayError("Unable to update folder, status code:"+statusCode+ " "+t.getMessage());
+				}
 				else
-					GSS.get().displayError(caught.getMessage());
-
+					GSS.get().displayError("System error moifying file:"+t.getMessage());
 			}
-		});
+		};
+		DeferredCommand.addCommand(ep);
 	}
 
+
+
 }
diff --git a/gss/src/gr/ebs/gss/client/Folders.java b/gss/src/gr/ebs/gss/client/Folders.java
index 788460f..f7ac517 100644
--- a/gss/src/gr/ebs/gss/client/Folders.java
+++ b/gss/src/gr/ebs/gss/client/Folders.java
@@ -18,13 +18,19 @@
  */
 package gr.ebs.gss.client;
 
+import gr.ebs.gss.client.dnd.DnDTreeItem;
 import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.UserDTO;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.OtherUserResource;
+import gr.ebs.gss.client.rest.resource.RestResource;
 import gr.ebs.gss.client.tree.FolderSubtree;
 import gr.ebs.gss.client.tree.MyShareSubtree;
 import gr.ebs.gss.client.tree.OthersSharesSubtree;
 import gr.ebs.gss.client.tree.TrashSubtree;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
@@ -153,14 +159,18 @@ public class Folders extends Composite {
 	 */
 	public Folders(final Images _images) {
 		images = _images;
+
 		tree = new PopupTree(images);
+		//ScrollPanel scr = new ScrollPanel(tree);
+		//scr.setSize("100%", "100%");
 		tree.setAnimationEnabled(true);
+		//initWidget(scr);
 		initWidget(tree);
 		folderSubtree = new FolderSubtree(tree, images);
 		myShareSubtree = new MyShareSubtree(tree, images);
 		trashSubtree = new TrashSubtree(tree, images);
-
 		othersSharesSubtree = new OthersSharesSubtree(tree, images);
+		//setHeight("100%");
 
 	}
 
@@ -203,26 +213,34 @@ public class Folders extends Composite {
 		return html;
 	}
 
-	public void update(Long userId, TreeItem item) {
+	public void update(TreeItem item) {
 		if (isFileItem(item))
-			folderSubtree.updateSubfolders(userId, item);
+			folderSubtree.updateSubfolders((DnDTreeItem) item);
 		else if (isTrash(item))
-			trashSubtree.update(item);
+			trashSubtree.update();
 		else if (isMySharedItem(item))
-			myShareSubtree.update(item);
+			myShareSubtree.update((DnDTreeItem)item);
 		else if (isOthersSharedItem(item))
-			othersSharesSubtree.update(item);
+			othersSharesSubtree.update((DnDTreeItem) item);
 	}
 
-	public void updateNode(TreeItem node, FolderDTO folder) {
-		if (isFileItem(node))
-			folderSubtree.updateNode(node, folder);
-		else if (isMySharedItem(node))
-			myShareSubtree.updateNode(node, folder);
-		else if (isOthersSharedItem(node))
-			othersSharesSubtree.updateNode(node, folder);
+	public void updateFolder(final DnDTreeItem folderItem){
+		if(isFileItem(folderItem)){
+			folderSubtree.updateFolderAndSubfolders(folderItem);
+			myShareSubtree.updateFolderAndSubfolders((DnDTreeItem) getMySharesItem());
+		}
+		else if(isMySharedItem(folderItem)){
+			myShareSubtree.updateFolderAndSubfolders(folderItem);
+			DnDTreeItem fitem = (DnDTreeItem) getUserItem(getRootItem(), folderItem.getFolderResource().getPath());
+			if(fitem != null)
+				folderSubtree.updateFolderAndSubfolders(fitem);
+		}
+		else if(isOthersShared(folderItem))
+			othersSharesSubtree.updateFolderAndSubfolders(folderItem);
 	}
 
+
+
 	/**
 	 * Retrieve the current.
 	 *
@@ -302,12 +320,12 @@ public class Folders extends Composite {
 	}
 
 	public TreeItem getUserOfSharedItem(TreeItem item) {
-		if (item.getUserObject() instanceof UserDTO)
+		if (item.getUserObject() instanceof OtherUserResource)
 			return item;
 		TreeItem test = item;
 		while (test != null && test.getParentItem() != null) {
 			test = test.getParentItem();
-			if (test.getUserObject() instanceof UserDTO)
+			if (test.getUserObject() instanceof OtherUserResource)
 				return test;
 		}
 		return null;
@@ -329,26 +347,26 @@ public class Folders extends Composite {
 	 * Returns the Tree Item corresponding to the FolderDTO object
 	 * since we need to update main file structure for untrashed folders
 	 */
-	public TreeItem getUserItem(FolderDTO folder) {
+	public TreeItem getUserItem(FolderResource folder) {
 
 		return getUserItem(getRootItem(), folder);
 	}
 
-	public TreeItem getOtherSharedItem(FolderDTO folder) {
+	public TreeItem getOtherSharedItem(FolderResource folder) {
 
 		return getUserItem(getSharesItem(), folder);
 	}
 
-	private TreeItem getUserItem(TreeItem parent, FolderDTO folder) {
+	private TreeItem getUserItem(TreeItem parent, FolderResource folder) {
 		TreeItem tmp = null;
-		if (parent.getUserObject() instanceof FolderDTO && (parent.getUserObject().equals(folder) || ((FolderDTO) parent.getUserObject())	.getId()
-																																			.equals(folder.getId())))
+		if (parent.getUserObject() instanceof FolderResource && (parent.getUserObject().equals(folder) || ((FolderResource) parent.getUserObject())	.getPath()
+																																			.equals(folder.getPath())))
 			return parent;
 		for (int i = 0; i < parent.getChildCount(); i++) {
 			TreeItem child = parent.getChild(i);
 			if (child.getUserObject() instanceof FolderDTO) {
-				FolderDTO dto = (FolderDTO) child.getUserObject();
-				if (dto.equals(folder) || dto.getId().equals(folder.getId()))
+				FolderResource dto = (FolderResource) child.getUserObject();
+				if (dto.equals(folder) || dto.getPath().equals(folder.getPath()))
 					return child;
 			}
 			tmp = getUserItem(child, folder);
@@ -359,6 +377,8 @@ public class Folders extends Composite {
 		return null;
 	}
 
+
+
 	/**
 	 * Retrieve the trashItem.
 	 *
@@ -395,82 +415,81 @@ public class Folders extends Composite {
 		return othersSharesSubtree.getRootItem();
 	}
 
-	public boolean isShared(FolderDTO folder) {
-		return myShareSubtree.isShared(folder);
-	}
+
 
 	public void onFolderTrash(TreeItem folder) {
-		if (folder.getParentItem().getUserObject() instanceof FolderDTO) {
-			FolderDTO folderDTO = (FolderDTO) folder.getParentItem().getUserObject();
+		if (folder.getParentItem().getUserObject() instanceof FolderResource) {
+			FolderResource folderDTO = (FolderResource) folder.getParentItem().getUserObject();
 			updateFileAndShareNodes(folderDTO);
-		} else {
-			update(GSS.get().getCurrentUser().getId(), getMySharesItem());
-			updateFileAndShareNodes(((FolderDTO) folder.getUserObject()).getParent());
-		}
-		update(GSS.get().getCurrentUser().getId(), getTrashItem());
+		} else
+			update(getMySharesItem());
+			//updateFileAndShareNodes(((FolderResource) folder.getUserObject()).getParent());
+		update( getTrashItem());
 		clearSelection();
-		GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
+		GSS.get().getFileList().updateFileCache(false);
 	}
 
 	public void onFolderDelete(TreeItem folder) {
-		if (folder.getParentItem().getUserObject() instanceof FolderDTO) {
-			FolderDTO folderDTO = (FolderDTO) folder.getParentItem().getUserObject();
+		if (folder.getParentItem().getUserObject() instanceof FolderResource) {
+			FolderResource folderDTO = (FolderResource) folder.getParentItem().getUserObject();
 			updateFileAndShareNodes(folderDTO);
-		} else {
-			update(GSS.get().getCurrentUser().getId(), getMySharesItem());
-			updateFileAndShareNodes(((FolderDTO) folder.getUserObject()).getParent());
-		}
+		} else
+			update( getMySharesItem());
+			//updateFileAndShareNodes(((FolderResource) folder.getUserObject()).getParent());
 		GSS.get().getStatusPanel().updateStats();
 		clearSelection();
-		GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
+		GSS.get().getFileList().updateFileCache(false);
 
 	}
 
 	public void onFolderCopy(TreeItem folder) {
-		if (!updateFileAndShareNodes((FolderDTO) folder.getUserObject()))
-			update(GSS.get().getCurrentUser().getId(), folder);
-		GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
+		if (!updateFileAndShareNodes((FolderResource) folder.getUserObject()))
+			update(folder);
+		GSS.get().getFileList().updateFileCache(false);
 		GSS.get().getStatusPanel().updateStats();
 	}
 
-	public void onFolderMove(TreeItem folder, FolderDTO initialParent) {
+	public void onFolderMove(TreeItem folder, FolderResource initialParent) {
 		updateFileAndShareNodes(initialParent);
-		updateFileAndShareNodes((FolderDTO) folder.getUserObject());
-
-		update(GSS.get().getCurrentUser().getId(), folder);
-		GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
+		updateFileAndShareNodes((FolderResource) folder.getUserObject());
+		update(folder);
+		GSS.get().getFileList().updateFileCache(false);
 		GSS.get().getStatusPanel().updateStats();
 		clearSelection();
 	}
 
-	public void onFolderUpdate(TreeItem folder) {
+	public void onFolderUpdate(String path) {
+		List items = getItemsOfTreeForPath(path);
+
+		/*
 		if(isFileItem(folder)){
-			folderSubtree.updateFolderAndSubfolders(GSS.get().getCurrentUser().getId(),folder);
-			TreeItem sharesFolder = getUserItem(getMySharesItem(), (FolderDTO)folder.getUserObject());
+			folderSubtree.updateFolderAndSubfolders((DnDTreeItem) folder);
+			TreeItem sharesFolder = getUserItem(getMySharesItem(), (FolderResource)folder.getUserObject());
 			if (sharesFolder != null)
-				myShareSubtree.updateFolderAndSubfolders(GSS.get().getCurrentUser().getId(), sharesFolder);
+				myShareSubtree.updateFolderAndSubfolders( (DnDTreeItem)sharesFolder);
 		}
 		if(isMySharedItem(folder)){
-			myShareSubtree.updateFolderAndSubfolders(GSS.get().getCurrentUser().getId(),folder);
-			TreeItem sharesFolder = getUserItem(getRootItem(), (FolderDTO)folder.getUserObject());
+			myShareSubtree.updateFolderAndSubfolders((DnDTreeItem)folder);
+			TreeItem sharesFolder = getUserItem(getRootItem(), (FolderResource)folder.getUserObject());
 			if (sharesFolder != null)
-				folderSubtree.updateFolderAndSubfolders(GSS.get().getCurrentUser().getId(), sharesFolder);
+				folderSubtree.updateFolderAndSubfolders((DnDTreeItem) sharesFolder);
 		}
 		if(isOthersSharedItem(folder))
-			othersSharesSubtree.updateFolderAndSubfolders(GSS.get().getCurrentUser().getId(),folder);
+			othersSharesSubtree.updateFolderAndSubfolders((DnDTreeItem)folder);
+			*/
 
 	}
 
-	private boolean updateFileAndShareNodes(FolderDTO folder) {
+	private boolean updateFileAndShareNodes(FolderResource folder) {
 		boolean updated = false;
 		TreeItem sharesFolder = getUserItem(getMySharesItem(), folder);
 		if (sharesFolder != null) {
-			update(GSS.get().getCurrentUser().getId(), sharesFolder);
+			update(sharesFolder);
 			updated = true;
 		}
 		TreeItem fileFolder = getUserItem(getRootItem(), folder);
 		if (fileFolder != null) {
-			update(GSS.get().getCurrentUser().getId(), fileFolder);
+			update(fileFolder);
 			updated = true;
 		}
 		return updated;
@@ -482,23 +501,60 @@ public class Folders extends Composite {
 
 				public void execute() {
 					GSS.get().showLoadingIndicator();
-
-					Long userId = GSS.get().getCurrentUser().getId();
 					folderSubtree.getRootItem().removeItems();
 					trashSubtree.getRootItem().removeItems();
 					myShareSubtree.getRootItem().removeItems();
 					othersSharesSubtree.getRootItem().removeItems();
-					update(userId,folderSubtree.getRootItem());
-					update(userId,trashSubtree.getRootItem());
-					update(userId,myShareSubtree.getRootItem());
-					update(userId,othersSharesSubtree.getRootItem());
+					update(folderSubtree.getRootItem());
+					update(trashSubtree.getRootItem());
+					update(myShareSubtree.getRootItem());
+					update(othersSharesSubtree.getRootItem());
 					GSS.get().setCurrentSelection(null);
 					clearSelection();
-					GSS.get().getFileList().updateFileCache(userId);
+					GSS.get().getFileList().updateFileCache(false);
 					GSS.get().hideLoadingIndicator();
 
 				}
 
 		});
 	}
+
+	/* NEW HANDLING METHODS */
+	public TreeItem getUserItem(TreeItem parent, String path) {
+		TreeItem tmp = null;
+		if (parent.getUserObject() instanceof RestResource &&
+					 ((RestResource) parent.getUserObject()).getPath().equals(path))
+			return parent;
+		for (int i = 0; i < parent.getChildCount(); i++) {
+			TreeItem child = parent.getChild(i);
+			if (child.getUserObject() instanceof RestResource) {
+				RestResource dto = (RestResource) child.getUserObject();
+				if (dto.getPath().equals(path))
+					return child;
+			}
+			tmp = getUserItem(child, path);
+			if (tmp != null)
+				return tmp;
+
+		}
+		return null;
+	}
+
+	public List getItemsOfTreeForPath(String path){
+		List result = new ArrayList();
+		TreeItem item = null;
+		item = getUserItem(getRootItem(), path);
+		if(item != null)
+			result.add(item);
+		item = getUserItem(getMySharesItem(), path);
+		if(item != null)
+			result.add(item);
+		item = getUserItem(getTrashItem(), path);
+		if(item != null)
+			result.add(item);
+		item = getUserItem(getSharesItem(), path);
+		if(item != null)
+			result.add(item);
+		return result;
+	}
 }
diff --git a/gss/src/gr/ebs/gss/client/GSS.java b/gss/src/gr/ebs/gss/client/GSS.java
index 0856ba6..353392d 100644
--- a/gss/src/gr/ebs/gss/client/GSS.java
+++ b/gss/src/gr/ebs/gss/client/GSS.java
@@ -20,8 +20,9 @@ package gr.ebs.gss.client;
 
 import gr.ebs.gss.client.clipboard.Clipboard;
 import gr.ebs.gss.client.dnd.DnDFocusPanel;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.exceptions.ObjectNotFoundException;
+import gr.ebs.gss.client.rest.ExecuteGet;
+import gr.ebs.gss.client.rest.resource.UserResource;
 
 import java.util.Iterator;
 
@@ -36,8 +37,6 @@ import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.WindowResizeListener;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
 import com.google.gwt.user.client.ui.AbsolutePanel;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.DockPanel;
@@ -76,11 +75,14 @@ public class GSS implements EntryPoint, WindowResizeListener {
 	 */
 	private static final String GSS_LOGOUT_URL = "http://gss.grnet.gr/Shibboleth.sso/Logout";
 
+	public static final String GSS_REST_PATH = GWT.getModuleBaseURL() + "rest/";
 	/**
 	 * A constant that denotes the completion of an IncrementalCommand.
 	 */
 	public static final boolean DONE = false;
 
+	public static final int VISIBLE_FILE_COUNT = 100;
+
 	/**
 	 * Instantiate an application-level image bundle. This object will provide
 	 * programmatic access to all the images needed by widgets.
@@ -88,7 +90,6 @@ public class GSS implements EntryPoint, WindowResizeListener {
 	private static Images images = (Images) GWT.create(Images.class);
 	GlassPanel glassPanel = new GlassPanel();
 
-
 	/**
 	 * An aggregate image bundle that pulls together all the images for this
 	 * application into a single bundle.
@@ -140,36 +141,12 @@ public class GSS implements EntryPoint, WindowResizeListener {
 	}
 
 	/**
-	 * An RPC service proxy.
-	 */
-	private GSSServiceAsync service;
-
-	/**
-	 * Return the service proxy. If this is the first time it is requested, it
-	 * is then stored for subsequent requests.
-	 *
-	 * @return the service proxy
-	 */
-	public GSSServiceAsync getRemoteService() {
-		if (service == null) {
-			GSSServiceAsync freshService = (GSSServiceAsync) GWT.create(GSSService.class);
-			ServiceDefTarget endpoint = (ServiceDefTarget) freshService;
-			String serviceUrl = GWT.getModuleBaseURL() + "gss";
-			GWT.log(serviceUrl, null);
-			endpoint.setServiceEntryPoint(serviceUrl);
-			service = freshService;
-		}
-		return service;
-	}
-	/**
 	 * The Application Clipboard implementation;
 	 */
 	private Clipboard clipboard = new Clipboard();
 
-	/**
-	 * The Application User Object
-	 */
-	private UserDTO currentUser;
+	private UserResource currentUserResource;
+
 	/**
 	 * The top panel that contains the menu bar.
 	 */
@@ -190,7 +167,6 @@ public class GSS implements EntryPoint, WindowResizeListener {
 	 */
 	private FileList fileList;
 
-
 	/**
 	 * The group list widget.
 	 */
@@ -217,7 +193,6 @@ public class GSS implements EntryPoint, WindowResizeListener {
 	 */
 	private HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
 
-
 	/**
 	 * The horizontal panel that will contain the search and status panels.
 	 */
@@ -243,8 +218,8 @@ public class GSS implements EntryPoint, WindowResizeListener {
 	 * The authentication token of the current user.
 	 */
 	private String token;
-	private PickupDragController dragController;
 
+	private PickupDragController dragController;
 
 	public void onModuleLoad() {
 		// Initialize the singleton before calling the constructors of the
@@ -327,7 +302,7 @@ public class GSS implements EntryPoint, WindowResizeListener {
 		splitPanel.setLeftWidget(folders);
 		splitPanel.setRightWidget(inner);
 		splitPanel.setSplitPosition("35%");
-		splitPanel.setSize("100%", "450px");
+		splitPanel.setSize("100%", "100%");
 
 		// Create a dock panel that will contain the menu bar at the top,
 		// the shortcuts to the left, the status bar at the bottom and the
@@ -373,29 +348,36 @@ public class GSS implements EntryPoint, WindowResizeListener {
 	 * @param username the username of the user
 	 */
 	private void fetchUser(final String username) {
+		final String path = GSS_REST_PATH+username+"/";
+		/*
+		GetUserCommand getUserCommand = new GetUserCommand(username, path){
+			@Override
+			public void onComplete() {
+				GWT.log("user fetch complete", null);
+				currentUserResource = getUser();
+			}
+			@Override
+			public void onError(Throwable t) {
+				GSS.get().displayError("No User Found:"+t.getMessage());
+				//authenticateUser();
+			}
+		};*/
+		ExecuteGet getUserCommand = new ExecuteGet(UserResource.class, username, path){
 
-		DeferredCommand.addCommand(new Command() {
-			public void execute() {
-				showLoadingIndicator();
-				getRemoteService().getUser(username, new AsyncCallback() {
-
-					public void onSuccess(Object result) {
-						currentUser = (UserDTO) result;
-						hideLoadingIndicator();
-					}
-
-					public void onFailure(Throwable caught) {
-						GWT.log("", caught);
-						hideLoadingIndicator();
-						if (caught instanceof RpcException)
-							GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-						else
-							GSS.get().displayError(caught.getMessage());
-						authenticateUser();
-					}
-				});
+			public void onComplete() {
+				currentUserResource = getResult();
 			}
-		});
+
+			public void onError(Throwable t) {
+				GWT.log("Fetching user error", t);
+				if(t instanceof ObjectNotFoundException)
+					GSS.get().displayError("No user found");
+				else
+					GSS.get().displayError("System error fetching user data:"+t.getMessage());
+				//authenticateUser();
+			}
+		};
+		DeferredCommand.addCommand(getUserCommand);
 	}
 
 	/**
@@ -406,6 +388,7 @@ public class GSS implements EntryPoint, WindowResizeListener {
 		// XXX This part is only for development environments!
 		// XXX Remove/comment for production deployment!
 		final String _username = Window.Location.getParameter("user");
+		token = Window.Location.getParameter("token");
 		if (_username != null) {
 			DeferredCommand.addCommand(new Command() {
 				public void execute() {
@@ -507,7 +490,15 @@ public class GSS implements EntryPoint, WindowResizeListener {
 	 * Make the file list visible.
 	 */
 	public void showFileList() {
-		fileList.updateFileCache(GSS.get().getCurrentUser().getId());
+		fileList.updateFileCache(false);
+		inner.selectTab(0);
+	}
+
+	/**
+	 * Make the file list visible.
+	 */
+	public void showFileList(boolean update) {
+		fileList.updateFileCache(update);
 		inner.selectTab(0);
 	}
 
@@ -516,7 +507,7 @@ public class GSS implements EntryPoint, WindowResizeListener {
 	 * @param query the search query string
 	 */
 	public void showSearchResults(String query) {
-		searchResults.updateFileCache(GSS.get().getCurrentUser().getId(), query);
+		searchResults.updateFileCache(query);
 		inner.selectTab(2);
 	}
 
@@ -657,14 +648,6 @@ public class GSS implements EntryPoint, WindowResizeListener {
 		return clipboard;
 	}
 
-	/**
-	 * Retrieve the currentUser.
-	 *
-	 * @return the currentUser
-	 */
-	public UserDTO getCurrentUser() {
-		return currentUser;
-	}
 
 	public StatusPanel getStatusPanel(){
 		return statusPanel;
@@ -687,4 +670,19 @@ public class GSS implements EntryPoint, WindowResizeListener {
 		glassPanel.removeFromParent();
 	}
 
+
+	/**
+	 * Retrieve the currentUserResource.
+	 *
+	 * @return the currentUserResource
+	 */
+	public UserResource getCurrentUserResource() {
+		return currentUserResource;
+	}
+
+
+
+
+
+
 }
diff --git a/gss/src/gr/ebs/gss/client/GSSService.java b/gss/src/gr/ebs/gss/client/GSSService.java
deleted file mode 100644
index a7e0e3a..0000000
--- a/gss/src/gr/ebs/gss/client/GSSService.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.
- *
- * This file is part of GSS.
- *
- * GSS is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GSS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GSS.  If not, see .
- */
-package gr.ebs.gss.client;
-
-import gr.ebs.gss.client.domain.FileBodyDTO;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.PermissionDTO;
-import gr.ebs.gss.client.domain.StatsDTO;
-import gr.ebs.gss.client.domain.UploadStatusDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.DuplicateNameException;
-import gr.ebs.gss.client.exceptions.GSSIOException;
-import gr.ebs.gss.client.exceptions.InsufficientPermissionsException;
-import gr.ebs.gss.client.exceptions.ObjectNotFoundException;
-import gr.ebs.gss.client.exceptions.QuotaExceededException;
-import gr.ebs.gss.client.exceptions.RpcException;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.List;
-import java.util.Set;
-
-import com.google.gwt.user.client.rpc.RemoteService;
-
-/**
- * The GSS service RPC interface.
- *
- * @author past
- */
-public interface GSSService extends RemoteService {
-
-	/**
-	 * Maximum number of files that are visible in the file list
-	 */
-	static final int VISIBLE_FILE_COUNT = 100;
-
-	/**
-	 * Maximum number of groups visible in the group list
-	 */
-	static final int VISIBLE_GROUP_COUNT = 3;
-
-	/**
-	 * Maximum number of users visible in the user list
-	 */
-	static final int VISIBLE_USERS_COUNT = 4;
-
-	/**
-	 * Returns the groups defined by the specified user
-	 *
-	 * @param userId
-	 * @return GroupDTO[]
-	 * @throws ObjectNotFoundException
-	 * @throws RpcException
-	 */
-	List getGroups(Long userId) throws ObjectNotFoundException, RpcException;
-
-	/**
-	 * Returns the users that are members of the specified group.
-	 *
-	 * @param userId the ID of the current user
-	 * @param groupId the ID of the requested group
-	 * @return an array of user objects
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException if the user or group was not found, with
-	 *             the exception message mentioning the precise problem
-	 */
-	List getUsers(Long userId, Long groupId) throws RpcException, ObjectNotFoundException;
-
-	/**
-	 * Returns the root folder of the specified user
-	 *
-	 * @param userId
-	 * @return FolderDTO
-	 * @throws RpcException
-	 * @throws ObjectNotFoundException
-	 */
-	FolderDTO getRootFolder(Long userId) throws RpcException, ObjectNotFoundException;
-
-	/**
-	 * Returns the specified folder of the supplied user.
-	 *
-	 * @param userId
-	 * @param folderId
-	 * @return FolderDTO
-	 * @throws RpcException
-	 * @throws ObjectNotFoundException
-	 * @throws InsufficientPermissionsException
-	 */
-	FolderDTO getFolder(Long userId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	/**
-	 * Returns the files of the specified folder.
-	 *
-	 * @param userId the ID of the user
-	 * @param folderId the ID of the folder containing the requested files
-	 * @return the files found in the folder
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException if the user or folder was not found, with
-	 *             the exception message mentioning the precise problem
-	 * @throws InsufficientPermissionsException
-	 */
-	List getFiles(Long userId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	/**
-	 * Creates a folder in the user's namespace.
-	 *
-	 * @param userId the ID of the user
-	 * @param parentId the ID of the parent folder
-	 * @param name the name of the new folder
-	 * @throws RpcException in case a communication error occurs
-	 * @throws DuplicateNameException in case a folder with the same name
-	 *             already exists inside the parent folder
-	 * @throws ObjectNotFoundException if the user or folder was not found, with
-	 *             the exception message mentioning the precise problem
-	 * @throws InsufficientPermissionsException
-	 */
-	void createFolder(Long userId, Long parentId, String name) throws RpcException, DuplicateNameException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	/**
-	 * Removes the specified folder from the user's namespace.
-	 *
-	 * @param userId the ID of the user
-	 * @param folderId the ID of the folder to remove
-	 * @throws RpcException in case a communication error occurs
-	 * @throws InsufficientPermissionsException in case the user does not have
-	 *             the necessary privileges to perform the operation
-	 * @throws ObjectNotFoundException if the user or folder was not found, with
-	 *             the exception message mentioning the precise problem
-	 */
-	void deleteFolder(Long userId, Long folderId) throws RpcException, InsufficientPermissionsException, ObjectNotFoundException;
-
-	/**
-	 * Retrieve the subfolders of the specified folder.
-	 *
-	 * @param userId the ID of the current user
-	 * @param folderId the ID of the specified folder
-	 * @return a List with the sublfolders
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException in case the specified folder was not
-	 *             found
-	 * @throws InsufficientPermissionsException
-	 */
-	List getSubfolders(Long userId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	/**
-	 * Retrieve the subfolders of the specified folder that are shared by user.
-	 *
-	 * @param userId the ID of the current user
-	 * @param folderId the ID of the specified folder
-	 * @return a List with the sublfolders
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException in case the specified folder was not
-	 *             found
-	 */
-	List getSharedSubfolders(Long userId, Long folderId) throws RpcException, ObjectNotFoundException;
-
-	/**
-	 * Retrieve the subfolders of the specified folder that are shared by user.
-	 *
-	 * @param userId the ID of the current user
-	 * @param callingUserId the ID of the user requesting operation
-	 * @param folderId the ID of the specified folder
-	 * @return a List with the sublfolders
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException in case the specified folder was not
-	 *             found
-	 */
-	List getSharedSubfolders(Long userId, Long callingUserId, Long folderId) throws RpcException, ObjectNotFoundException;
-
-	/**
-	 * Modify the specified folder.
-	 *
-	 * @param userId the ID of the current user
-	 * @param folderId the ID of the specified folder
-	 * @param folderName the new folder name
-	 * @throws RpcException in case a communication error occurs
-	 * @throws InsufficientPermissionsException in case the user does not have
-	 *             the necessary privileges to perform the operation
-	 * @throws ObjectNotFoundException if the user or folder was not found, with
-	 *             the exception message mentioning the precise problem
-	 * @throws DuplicateNameException if the modified folder name already exists
-	 *             in the parent folder
-	 */
-	void modifyFolder(Long userId, Long folderId, String folderName) throws RpcException, InsufficientPermissionsException, ObjectNotFoundException, DuplicateNameException;
-
-	/**
-	 * Creates a group in the user's namespace.
-	 *
-	 * @param userId the ID of the user
-	 * @param name the name of the new group
-	 * @throws RpcException in case a communication error occurs
-	 * @throws DuplicateNameException in case a folder with the same name
-	 *             already exists inside the parent folder
-	 * @throws ObjectNotFoundException if the user or group was not found, with
-	 *             the exception message mentioning the precise problem
-	 */
-	void createGroup(Long userId, String name) throws RpcException, DuplicateNameException, ObjectNotFoundException;
-
-	/**
-	 * Removes the specified group from the user's namespace.
-	 *
-	 * @param userId the ID of the user
-	 * @param groupId the ID of the group to remove
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException if the user or group was not found, with
-	 *             the exception message mentioning the precise problem
-	 * @throws InsufficientPermissionsException
-	 */
-	void deleteGroup(Long userId, Long groupId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	/**
-	 * Removes the specified file from the user's namespace.
-	 *
-	 * @param userId the ID of the user
-	 * @param fileId the ID of the file to remove
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException if the user or file was not found, with
-	 *             the exception message mentioning the precise problem
-	 * @throws InsufficientPermissionsException if the user does not have the
-	 *             appropriate privileges
-	 */
-	void deleteFile(Long userId, Long fileId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	/**
-	 * Returns all tags defined by the specified user
-	 *
-	 * @param userId
-	 * @return Set
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException if the user was null
-	 */
-	Set getUserTags(Long userId) throws RpcException, ObjectNotFoundException;
-
-	/**
-	 * Updates file name and tags for the specified file
-	 *
-	 * @param userId
-	 * @param fileId
-	 * @param name
-	 * @param tagSet a String that contains tags separated by comma
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException if the user or file was null or not found
-	 * @throws InsufficientPermissionsException
-	 */
-	void updateFile(Long userId, Long fileId, String name, String tagSet) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	void copyFile(Long userId, Long fileId, String dest) throws RpcException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException, QuotaExceededException, GSSIOException;
-
-	void copyFile(Long userId, Long fileId, Long destId, String destName) throws RpcException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException, QuotaExceededException, GSSIOException;
-
-	void copyFolder(Long userId, Long folderId, String dest) throws RpcException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException;
-
-	void copyFolder(Long userId, Long folderId, Long destId, String destName) throws RpcException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException;
-
-	void copyFolderStructure(Long userId, Long folderId, Long destId, String destName) throws RpcException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException, QuotaExceededException, GSSIOException;
-
-	void moveFileToTrash(Long userId, Long fileId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	void removeFileFromTrash(Long userId, Long fileId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	UserDTO getUser(String username) throws RpcException, ObjectNotFoundException;
-
-	void moveFolder(Long userId, Long folderId, Long destId, String destName) throws RpcException, InsufficientPermissionsException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException, QuotaExceededException, GSSIOException;
-
-	void moveFile(Long userId, Long fileId, Long destId, String destName) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException, DuplicateNameException, QuotaExceededException, GSSIOException;
-
-	void moveFolderToTrash(Long userId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	void removeFolderFromTrash(Long userId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	/**
-	 * Returns the deleted files of the specified user.
-	 *
-	 * @param userId the ID of the user
-	 * 	 * @return the files found in the folder
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException if the user was not found, with
-	 *             the exception message mentioning the precise problem
-	 */
-	List getDeletedFiles(Long userId) throws RpcException, ObjectNotFoundException;
-
-	/**
-	 * Returns the deleted root folders of the specified user.
-	 *
-	 * @param userId the ID of the user
-	 * 	 * @return the deleted root folders found in the folder
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException if the user was not found, with
-	 *             the exception message mentioning the precise problem
-	 */
-	List getDeletedRootFolders(Long userId) throws RpcException, ObjectNotFoundException;
-
-	/**
-	 * Empty Trash by deleting all marked as deleted files and folders
-	 * @param userId
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException if something goes wrong in the delete process
-	 * @throws InsufficientPermissionsException  if something goes wrong in the delete process
-	 */
-	void emptyTrash(Long userId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	/**
-	 * Restores All Trashed Items by undeleting all marked as deleted files and folders
-	 * @param userId
-	 * @throws RpcException in case a communication error occurs
-	 * @throws ObjectNotFoundException if something goes wrong in the delete process
-	 * @throws InsufficientPermissionsException
-	 *
-	 */
-	void restoreTrash(Long userId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	Set getFolderPermissions(Long userId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	void setFolderPermissions(Long userId, Long folderId, Set permissions) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	Set getFilePermissions(Long userId, Long fileId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	void setFilePermissions(Long userId, Long fileId, boolean readForAll, Set permissions) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-
-	List getUsersByUserNameLike(String username) throws RpcException;
-
-	void addUserToGroup(Long userId, Long groupId, Long userToAddId) throws RpcException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException;
-
-	List getSharedRootFolders(Long userId) throws RpcException, ObjectNotFoundException;
-
-	List getSharedFiles(Long userId) throws RpcException, ObjectNotFoundException;
-
-	void removeMemberFromGroup(Long userId, Long groupId, Long memberId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	List getUsersSharingFoldersForUser(Long userId) throws RpcException, ObjectNotFoundException;
-
-	List getSharedRootFolders(Long userId, Long callingUserId) throws RpcException, ObjectNotFoundException;
-
-	List getSharedFiles(Long userId, Long callingUserId) throws RpcException, ObjectNotFoundException;
-
-	List searchFiles(Long userId, String query) throws ObjectNotFoundException, RpcException;
-
-	void copyFiles(Long userId, List fileIds, Long destId) throws ObjectNotFoundException, DuplicateNameException,  InsufficientPermissionsException, RpcException, QuotaExceededException, GSSIOException;
-
-	void moveFiles(Long userId, List fileIds, Long destId) throws ObjectNotFoundException, DuplicateNameException,  InsufficientPermissionsException, RpcException, QuotaExceededException, GSSIOException;
-
-	void moveFilesToTrash(Long userId, List fileIds) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	void deleteFiles(Long userId, List fileIds) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	void removeFilesFromTrash(Long userId, List fileIds) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	StatsDTO getUserStatistics(Long userId) throws RpcException, ObjectNotFoundException;
-
-
-
-	/**
-	 * Retrieves file versions
-	 *
-	 * @param userId the ID of the user
-	 * @param fileId the ID of the file
-	 * @return the list of filebodies
-	 * @throws ObjectNotFoundException
-	 * @throws InsufficientPermissionsException
-	 *
-	 */
-	List getVersions(Long userId, Long fileId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	/**
-	 * Restore file version identified by bodyId
-	 *
-	 * @param userId the ID of the user
-	 * @param fileId the ID of the file
-	 *
-	 * @throws ObjectNotFoundException
-	 * @throws InsufficientPermissionsException
-	 * @throws QuotaExceededException
-	 * @throws GSSIOException
-	 * @throws FileNotFoundException
-	 * @throws IOException
-	 * @throws FileNotFoundException
-	 *
-	 */
-	void restoreVersion(Long userId, Long fileId, Long bodyId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException, QuotaExceededException,  GSSIOException;
-
-	/**
-	 * Remove file version identified by bodyId
-	 *
-	 * @param userId the ID of the user
-	 * @param fileId the ID of the file
-	 *
-	 * @throws ObjectNotFoundException
-	 * @throws InsufficientPermissionsException
-	 *
-	 */
-	void removeVersion(Long userId, Long fileId, Long bodyId) throws RpcException,ObjectNotFoundException, InsufficientPermissionsException;
-
-	void removeOldVersions(Long userId, Long fileId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	void toggleFileVersioning(Long userId, Long fileId, boolean versioned) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	UploadStatusDTO getUploadStatus(Long userId, String fileName) throws RpcException, ObjectNotFoundException;
-
-	FolderDTO getFolderWithSubfolders(Long userId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-
-	FolderDTO getFolderWithSubfolders(Long userId, Long callingUserId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException;
-}
diff --git a/gss/src/gr/ebs/gss/client/GSSServiceAsync.java b/gss/src/gr/ebs/gss/client/GSSServiceAsync.java
deleted file mode 100644
index 39601e4..0000000
--- a/gss/src/gr/ebs/gss/client/GSSServiceAsync.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.
- *
- * This file is part of GSS.
- *
- * GSS is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GSS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GSS.  If not, see .
- */
-package gr.ebs.gss.client;
-
-import gr.ebs.gss.client.domain.PermissionDTO;
-
-import java.util.List;
-import java.util.Set;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-/**
- * The GSS service RPC interface for clients that will be calling
- * asynchronously.
- *
- * @author past
- */
-public interface GSSServiceAsync {
-
-	/**
-	 * Returns the groups defined by the specified user.
-	 *
-	 * @param userId
-	 * @param callback
-	 */
-	void getGroups(Long userId, AsyncCallback callback);
-
-	/**
-	 * Returns the users that are members of the specified group.
-	 *
-	 * @param userId the ID of the current user
-	 * @param groupId the ID of the requested group
-	 * @param callback the callback that will be used for responding
-	 */
-	void getUsers(Long userId, Long groupId, AsyncCallback callback);
-
-	/**
-	 * Returns the root folder of the specified user
-	 *
-	 * @param userId
-	 * @param callback
-	 */
-	void getRootFolder(Long userId, AsyncCallback callback);
-
-	/**
-	 * Returns the specified folder of the supplied user.
-	 *
-	 * @param userId the ID of the user
-	 * @param folderId the ID of the requested folder
-	 * @param callback the callback that will be used for responding
-	 */
-	void getFolder(Long userId, Long folderId, AsyncCallback callback);
-
-	/**
-	 * Returns the files of the specified folder.
-	 *
-	 * @param userId the ID of the user
-	 * @param folderId the ID of the folder containing the requested files
-	 * @param callback the callback that will be used for responding
-	 */
-	void getFiles(Long userId, Long folderId, AsyncCallback callback);
-
-	/**
-	 * Creates a folder in the user's namespace.
-	 *
-	 * @param userId the ID of the user
-	 * @param parentId the ID of the parent folder
-	 * @param name the name of the new folder
-	 * @param callback the callback that will be used for responding
-	 */
-	void createFolder(Long userId, Long parentId, String name, AsyncCallback callback);
-
-	/**
-	 * Removes the specified folder from the user's namespace.
-	 *
-	 * @param userId the ID of the user
-	 * @param folderId the ID of the folder to remove
-	 * @param callback the callback that will be used for responding
-	 */
-	void deleteFolder(Long userId, Long folderId, AsyncCallback callback);
-
-	/**
-	 * Retrieve the subfolders of the specified folder.
-	 *
-	 * @param userId the ID of the current user
-	 * @param folderId the ID of the specified folder
-	 * @param callback the callback that will be used for responding
-	 */
-	void getSubfolders(Long userId, Long folderId, AsyncCallback callback);
-
-	/**
-	 * Modify the specified folder.
-	 *
-	 * @param userId the ID of the current user
-	 * @param folderId the ID of the specified folder
-	 * @param folderName the new folder name
-	 * @param callback the callback that will be used for responding
-	 */
-	void modifyFolder(Long userId, Long folderId, String folderName, AsyncCallback callback);
-
-	/**
-	 * Creates a group in the user's namespace.
-	 *
-	 * @param userId the ID of the user
-	 * @param groupName the name of the new group
-	 * @param callback the callback that will be used for responding
-	 */
-	void createGroup(Long userId, String groupName, AsyncCallback callback);
-
-	/**
-	 * Removes the specified group from the user's namespace.
-	 *
-	 * @param userId the ID of the user
-	 * @param groupId the ID of the group to remove
-	 * @param callback the callback that will be used for responding
-	 */
-	void deleteGroup(Long userId, Long groupId, AsyncCallback callback);
-
-	/**
-	 * Removes the specified file from the user's namespace.
-	 *
-	 * @param userId the ID of the user
-	 * @param fileId the ID of the file to remove
-	 * @param callback the callback that will be used for responding
-	 */
-	void deleteFile(Long userId, Long fileId, AsyncCallback callback);
-
-	/**
-	 * Returns all tags defined by the specified user
-	 *
-	 * @param userId
-	 * @param callback the callback that will be used for responding
-	 */
-	void getUserTags(Long userId, AsyncCallback callback);
-
-	/**
-	 * Updates file name and tags for the specified file
-	 *
-	 * @param userId
-	 * @param fileId
-	 * @param name
-	 * @param tagSet a String that contains tags separated by comma
-	 * @param callback the callback that will be used for responding
-	 */
-	void updateFile(Long userId, Long fileId, String name, String tagSet, AsyncCallback callback);
-
-	void copyFile(Long userId, Long fileId, String dest, AsyncCallback callback);
-
-	void copyFile(Long userId, Long fileId, Long destId, String destName, AsyncCallback callback);
-
-	void copyFolder(Long userId, Long folderId, String dest, AsyncCallback callback);
-
-	void copyFolder(Long userId, Long folderId, Long destId, String destName, AsyncCallback callback);
-
-	void copyFolderStructure(Long userId, Long folderId, Long destId, String destName, AsyncCallback callback);
-
-	void moveFileToTrash(Long userId, Long fileId, AsyncCallback callback);
-
-	void removeFileFromTrash(Long userId, Long fileId, AsyncCallback callback);
-
-	void moveFolderToTrash(Long userId, Long folderId, AsyncCallback callback);
-
-	void removeFolderFromTrash(Long userId, Long folderId, AsyncCallback callback);
-
-	void getUser(String username, AsyncCallback callback);
-
-	void moveFolder(Long userId, Long folderId, Long destId, String destName, AsyncCallback callback);
-
-	void moveFile(Long userId, Long fileId, Long destId, String destName, AsyncCallback callback);
-
-	void getDeletedFiles(Long userId, AsyncCallback callback);
-
-	void getDeletedRootFolders(Long userId, AsyncCallback callback);
-
-	void emptyTrash(Long userId, AsyncCallback callback);
-
-	void restoreTrash(Long userId, AsyncCallback callback);
-
-	void getFolderPermissions(Long userId, Long folderId, AsyncCallback callback);
-
-	void setFolderPermissions(Long userId, Long folderId, Set permissions, AsyncCallback callback);
-
-	void getFilePermissions(Long userId, Long fileId, AsyncCallback callback);
-
-	void setFilePermissions(Long userId, Long fileId, boolean readForAll, Set permissions, AsyncCallback callback);
-
-	void getUsersByUserNameLike(String username, AsyncCallback callback);
-
-	void addUserToGroup(Long userId, Long groupId, Long userToAddId, AsyncCallback callback);
-
-	void getSharedRootFolders(Long userId, AsyncCallback callback);
-
-	void removeMemberFromGroup(Long userId, Long groupId, Long memberId, AsyncCallback callback);
-
-	void getUsersSharingFoldersForUser(Long userId, AsyncCallback callback);
-
-	void getSharedFiles(Long userId, AsyncCallback callback);
-
-	void getSharedRootFolders(Long userId, Long callingUserId, AsyncCallback callback);
-
-	void getSharedFiles(Long userId, Long callingUserId, AsyncCallback callback);
-
-	void getSharedSubfolders(Long userId, Long folderId, AsyncCallback callback);
-
-	void getSharedSubfolders(Long userId, Long callingUserId, Long folderId, AsyncCallback callback);
-
-	void searchFiles(Long userId, String query, AsyncCallback callback);
-
-	void copyFiles(Long userId, List fileIds, Long destId, AsyncCallback callback);
-
-	void moveFiles(Long userId, List fileIds, Long destId, AsyncCallback callback);
-
-	void moveFilesToTrash(Long userId, List fileIds, AsyncCallback callback);
-
-	void deleteFiles(Long userId, List fileIds, AsyncCallback callback);
-
-	void removeFilesFromTrash(Long userId, List fileIds, AsyncCallback callback);
-
-	void getUserStatistics(Long userId, AsyncCallback callback);
-
-	void getVersions(Long userId, Long fileId, AsyncCallback callback);
-
-	void restoreVersion(Long userId, Long fileId, Long bodyId, AsyncCallback callback);
-
-	void removeVersion(Long userId, Long fileId, Long bodyId, AsyncCallback callback);
-
-	void removeOldVersions(Long userId, Long fileId, AsyncCallback callback);
-
-	void toggleFileVersioning(Long userId, Long fileId, boolean versioned, AsyncCallback callback);
-
-	void getUploadStatus(Long userId, String fileName, AsyncCallback callback);
-
-	void getFolderWithSubfolders(Long userId, Long folderId, AsyncCallback callback);
-
-	void getFolderWithSubfolders(Long userId, Long callingUserId, Long folderId, AsyncCallback callback);
-}
diff --git a/gss/src/gr/ebs/gss/client/GroupMenu.java b/gss/src/gr/ebs/gss/client/GroupMenu.java
index 6965ee2..ac84770 100644
--- a/gss/src/gr/ebs/gss/client/GroupMenu.java
+++ b/gss/src/gr/ebs/gss/client/GroupMenu.java
@@ -19,13 +19,13 @@
 package gr.ebs.gss.client;
 
 import gr.ebs.gss.client.commands.NewGroupCommand;
-import gr.ebs.gss.client.exceptions.DuplicateNameException;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecutePost;
+import gr.ebs.gss.client.rest.RestException;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.ClickListener;
 import com.google.gwt.user.client.ui.ImageBundle;
@@ -124,40 +124,39 @@ public class GroupMenu extends PopupPanel implements ClickListener {
 	 *            groups
 	 * @param groupName the name of the group to create
 	 */
-	private void createGroup(final Long userId, final String groupName) {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
+	private void createGroup( final String groupName) {
 		if (groupName == null || groupName.length() == 0) {
 			GSS.get().displayError("Empty group name!");
 			return;
 		}
-		GWT.log("createGroup(" + userId + "," + groupName + ")", null);
-		service.createGroup(userId, groupName, new AsyncCallback() {
+		GWT.log("createGroup(" + groupName + ")", null);
+		ExecutePost cg = new ExecutePost(GSS.get().getCurrentUserResource().getGroupsPath()+"?name="+groupName, "", 201){
 
-			public void onSuccess(final Object result) {
-				GSS.get().getGroups().updateGroups(GSS.get().getCurrentUser().getId());
+			public void onComplete() {
+				GSS.get().getGroups().updateGroups();
+				GSS.get().showUserList();
 			}
 
-			public void onFailure(final Throwable caught) {
-				if (caught instanceof DuplicateNameException) {
-					// If the supplied name already exists in the parent folder,
-					// alter it until we get one that doesn't.
-					String newName = null;
-					if (groupName.equals(NEW_GROUP_NAME))
-						newName = NEW_GROUP_NAME + " 1";
-					else {
-						final int num = Integer.parseInt(groupName.substring(groupName.lastIndexOf(' ')).trim());
-						newName = NEW_GROUP_NAME + " " + (num + 1);
-					}
-					createGroup(userId, newName);
-				} else {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				if(t instanceof RestException){
+					int statusCode = ((RestException)t).getHttpStatusCode();
+					if(statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions");
+					else if(statusCode == 404)
+						GSS.get().displayError("Resource does not exist");
+					else if(statusCode == 409)
+						GSS.get().displayError("A group with the same name already exists");
+					else if(statusCode == 413)
+						GSS.get().displayError("Your quota has been exceeded");
 					else
-						GSS.get().displayError(caught.getMessage());
+						GSS.get().displayError("Unable to create group, status code:"+statusCode);
 				}
+				else
+					GSS.get().displayError("System error creating group:"+t.getMessage());
 			}
-		});
+		};
+		DeferredCommand.addCommand(cg);
 	}
 
 
diff --git a/gss/src/gr/ebs/gss/client/GroupPropertiesDialog.java b/gss/src/gr/ebs/gss/client/GroupPropertiesDialog.java
index 963fdef..f97a337 100644
--- a/gss/src/gr/ebs/gss/client/GroupPropertiesDialog.java
+++ b/gss/src/gr/ebs/gss/client/GroupPropertiesDialog.java
@@ -19,10 +19,11 @@
 package gr.ebs.gss.client;
 
 import gr.ebs.gss.client.GroupMenu.Images;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecutePost;
+import gr.ebs.gss.client.rest.RestException;
 
 import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.ClickListener;
 import com.google.gwt.user.client.ui.DialogBox;
@@ -80,7 +81,7 @@ public class GroupPropertiesDialog extends DialogBox {
 		final Button ok = new Button("OK", new ClickListener() {
 
 			public void onClick(Widget sender) {
-				createGroup(GSS.get().getCurrentUser().getId(),groupName.getText());
+				createGroup(groupName.getText());
 				hide();
 			}
 		});
@@ -117,7 +118,7 @@ public class GroupPropertiesDialog extends DialogBox {
 		switch (key) {
 			case KeyboardListener.KEY_ENTER:
 				hide();
-				createGroup(GSS.get().getCurrentUser().getId(), groupName.getText());
+				createGroup( groupName.getText());
 				break;
 			case KeyboardListener.KEY_ESCAPE:
 				hide();
@@ -133,29 +134,40 @@ public class GroupPropertiesDialog extends DialogBox {
 	 *            groups
 	 * @param groupName the name of the group to create
 	 */
-	private void createGroup(final Long userId, final String groupName) {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
+	private void createGroup( final String groupName) {
+
 		if (groupName == null || groupName.length() == 0) {
 			GSS.get().displayError("Empty group name!");
 			return;
 		}
-		GWT.log("createGroup(" + userId + "," + groupName + ")", null);
-		service.createGroup(userId, groupName, new AsyncCallback() {
+		GWT.log("createGroup(" + groupName + ")", null);
+		ExecutePost cg = new ExecutePost(GSS.get().getCurrentUserResource().getGroupsPath()+"?name="+groupName, "", 201){
 
-			public void onSuccess(final Object result) {
-				GSS.get().getGroups().updateGroups(GSS.get().getCurrentUser().getId());
+			public void onComplete() {
+				GSS.get().getGroups().updateGroups();
 				GSS.get().showUserList();
 			}
 
-			public void onFailure(final Throwable caught) {
-
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				if(t instanceof RestException){
+					int statusCode = ((RestException)t).getHttpStatusCode();
+					if(statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions");
+					else if(statusCode == 404)
+						GSS.get().displayError("Resource does not exist");
+					else if(statusCode == 409)
+						GSS.get().displayError("A group with the same name already exists");
+					else if(statusCode == 413)
+						GSS.get().displayError("Your quota has been exceeded");
+					else
+						GSS.get().displayError("Unable to create group, status code:"+statusCode);
+				}
 				else
-					GSS.get().displayError(caught.getMessage());
-
+					GSS.get().displayError("System error creating group:"+t.getMessage());
 			}
-		});
+		};
+		DeferredCommand.addCommand(cg);
+
 	}
 }
diff --git a/gss/src/gr/ebs/gss/client/Groups.java b/gss/src/gr/ebs/gss/client/Groups.java
index c4f87bd..03b5ee2 100644
--- a/gss/src/gr/ebs/gss/client/Groups.java
+++ b/gss/src/gr/ebs/gss/client/Groups.java
@@ -18,17 +18,18 @@
  */
 package gr.ebs.gss.client;
 
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteGet;
+import gr.ebs.gss.client.rest.ExecuteMultipleGet;
+import gr.ebs.gss.client.rest.resource.GroupResource;
+import gr.ebs.gss.client.rest.resource.GroupUserResource;
+import gr.ebs.gss.client.rest.resource.GroupsResource;
 
-import java.util.Iterator;
 import java.util.List;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.HTML;
@@ -147,38 +148,65 @@ public class Groups extends Composite implements TreeListener {
 	 *
 	 * @param userId the user ID
 	 */
-	public void updateGroups(final Long userId) {
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		service.getGroups(userId, new AsyncCallback() {
+	public void updateGroups() {
+		ExecuteGet gg = new ExecuteGet(GroupsResource.class, GSS.get().getCurrentUserResource().getGroupsPath()){
+
+			public void onComplete() {
+				GroupsResource res = getResult();
+				ExecuteMultipleGet ga = new ExecuteMultipleGet(GroupResource.class, res.getGroupPaths().toArray(new String[]{})){
+
+					public void onComplete() {
+						List groupList = getResult();
+						tree.clear();
+						for (int i = 0; i < groupList.size(); i++) {
+							final TreeItem item = new TreeItem(imageItemHTML(images.groupImage(), groupList.get(i).getName()));
+							item.setUserObject(groupList.get(i));
+							tree.addItem(item);
+							updateUsers( item);
+						}
+					}
 
-			public void onSuccess(final Object result) {
-				final List groupList = (List) result;
-				GWT.log("got " + groupList.size() + " groups", null);
-				tree.clear();
-				for (int i = 0; i < groupList.size(); i++) {
-					final TreeItem item = new TreeItem(imageItemHTML(images.groupImage(), groupList.get(i).getName()));
-					item.setUserObject(groupList.get(i));
-					tree.addItem(item);
-					final Iterator iter = groupList.get(i).getMembers().iterator();
-					while (iter.hasNext()) {
-						final UserDTO user = (UserDTO) iter.next();
-						final TreeItem userItem = addImageItem(item, user.getName() + " <" + user.getEmail() + ">", images.permUser());
-						userItem.setUserObject(user);
+
+					public void onError(Throwable t) {
+						GWT.log("", t);
 					}
-				}
-				GSS.get().hideLoadingIndicator();
+
+					public void onError(String p, Throwable throwable) {
+						GWT.log("Path:"+p, throwable);
+					}
+				};
+				DeferredCommand.addCommand(ga);
 			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
+
+			public void onError(Throwable t) {
+
+			}
+		};
+		DeferredCommand.addCommand(gg);
+		/*
+		GetGroupsCommand gg = new GetGroupsCommand(GSS.get().getCurrentUserResource().getGroupsPath()){
+
+			public void onComplete() {
+				GroupsResource res = getResource();
+				GetAllGroupsCommand ga = new GetAllGroupsCommand(res.getGroupPaths().toArray(new String[]{})){
+
+					public void onComplete() {
+						List groupList = getList();
+						tree.clear();
+						for (int i = 0; i < groupList.size(); i++) {
+							final TreeItem item = new TreeItem(imageItemHTML(images.groupImage(), groupList.get(i).getName()));
+							item.setUserObject(groupList.get(i));
+							tree.addItem(item);
+							updateUsers( item);
+						}
+					}
+				};
+				DeferredCommand.addCommand(ga);
 			}
-		});
+		};
+		DeferredCommand.addCommand(gg);*/
+
 	}
 
 	/**
@@ -249,7 +277,7 @@ public class Groups extends Composite implements TreeListener {
 			return;
 
 		setChanged(item);
-		updateUsers(GSS.get().getCurrentUser().getId(), item);
+		updateUsers( item);
 	}
 
 	/**
@@ -260,8 +288,45 @@ public class Groups extends Composite implements TreeListener {
 	 * @param groupItem the TreeItem widget that corresponds to the requested
 	 *            group
 	 */
-	void updateUsers(final Long userId, final TreeItem groupItem) {
-		GSS.get().showLoadingIndicator();
+	void updateUsers(final TreeItem groupItem) {
+		if(groupItem.getUserObject() instanceof GroupResource){
+			GroupResource res = (GroupResource) groupItem.getUserObject();
+			ExecuteMultipleGet gu = new ExecuteMultipleGet(GroupUserResource.class, res.getUserPaths().toArray(new String[]{})){
+				public void onComplete() {
+					List users = getResult();
+					groupItem.removeItems();
+					for (int i = 0; i < users.size(); i++) {
+						final TreeItem userItem = addImageItem(groupItem, users.get(i).getName() + " <" + users.get(i).getUsername() + ">", images.permUser());
+						userItem.setUserObject(users.get(i));
+					}
+				}
+
+
+				public void onError(Throwable t) {
+					GWT.log("", t);
+				}
+
+				public void onError(String p, Throwable throwable) {
+					GWT.log("Path:"+p, throwable);
+				}
+			};
+			DeferredCommand.addCommand(gu);
+			/*
+			GetGroupUsersCommand gu = new GetGroupUsersCommand(res.getUserPaths().toArray(new String[]{})){
+
+				public void onComplete() {
+					super.onComplete();
+					List users = getList();
+					groupItem.removeItems();
+					for (int i = 0; i < users.size(); i++) {
+						final TreeItem userItem = addImageItem(groupItem, users.get(i).getName() + " <" + users.get(i).getUsername() + ">", images.permUser());
+						userItem.setUserObject(users.get(i));
+					}
+				}
+			};
+			DeferredCommand.addCommand(gu);*/
+		}
+		/*GSS.get().showLoadingIndicator();
 		final GSSServiceAsync service = GSS.get().getRemoteService();
 		final GroupDTO g = (GroupDTO) groupItem.getUserObject();
 		final Long groupId = g.getId();
@@ -289,7 +354,7 @@ public class Groups extends Composite implements TreeListener {
 				else
 					GSS.get().displayError(caught.getMessage());
 			}
-		});
+		});*/
 	}
 
 	/**
@@ -345,6 +410,6 @@ public class Groups extends Composite implements TreeListener {
 	public void setVisible(final boolean visible) {
 		super.setVisible(visible);
 		if (visible)
-			updateGroups(GSS.get().getCurrentUser().getId());
+			updateGroups();
 	}
 }
diff --git a/gss/src/gr/ebs/gss/client/PermissionsAddDialog.java b/gss/src/gr/ebs/gss/client/PermissionsAddDialog.java
index 2ba9e55..3b91c7b 100644
--- a/gss/src/gr/ebs/gss/client/PermissionsAddDialog.java
+++ b/gss/src/gr/ebs/gss/client/PermissionsAddDialog.java
@@ -19,13 +19,11 @@
 package gr.ebs.gss.client;
 
 import gr.ebs.gss.client.FilePropertiesDialog.Images;
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.PermissionDTO;
-import gr.ebs.gss.client.domain.UserDTO;
+import gr.ebs.gss.client.rest.resource.GroupResource;
+import gr.ebs.gss.client.rest.resource.PermissionHolder;
 
 import java.util.List;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.CheckBox;
 import com.google.gwt.user.client.ui.ClickListener;
@@ -35,9 +33,7 @@ import com.google.gwt.user.client.ui.HasHorizontalAlignment;
 import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.KeyboardListener;
 import com.google.gwt.user.client.ui.ListBox;
-import com.google.gwt.user.client.ui.SuggestBox;
-import com.google.gwt.user.client.ui.SuggestionEvent;
-import com.google.gwt.user.client.ui.SuggestionHandler;
+import com.google.gwt.user.client.ui.TextBox;
 import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
 
@@ -46,13 +42,13 @@ import com.google.gwt.user.client.ui.Widget;
  */
 public class PermissionsAddDialog extends DialogBox {
 
-	private ServerSuggestOracle suggestOracle = new ServerSuggestOracle();
 
-	private SuggestBox suggestBox = new SuggestBox(suggestOracle);
 
-	private UserDTO selectedUser = null;
+	private TextBox suggestBox = new TextBox();
 
-	private List groups;
+	private String selectedUser = null;
+
+	private List groups;
 
 	private ListBox groupBox = new ListBox();
 
@@ -66,12 +62,12 @@ public class PermissionsAddDialog extends DialogBox {
 
 	boolean userAdd;
 
-	public PermissionsAddDialog(final Images images, List groups, PermissionsList permList, boolean userAdd) {
+	public PermissionsAddDialog(final Images images, List groups, PermissionsList permList, boolean userAdd) {
 		this.groups = groups;
 		this.userAdd = userAdd;
 		this.permList = permList;
-		for (GroupDTO group : groups)
-			groupBox.addItem(group.getName(), group.getId().toString());
+		for (GroupResource group : groups)
+			groupBox.addItem(group.getName(), group.getName());
 		final VerticalPanel panel = new VerticalPanel();
 		final HorizontalPanel buttons = new HorizontalPanel();
 		setWidget(panel);
@@ -84,19 +80,9 @@ public class PermissionsAddDialog extends DialogBox {
 		permTable.getFlexCellFormatter().setStyleName(0, 1, "props-toplabels");
 		permTable.getFlexCellFormatter().setStyleName(0, 2, "props-toplabels");
 		permTable.getFlexCellFormatter().setStyleName(0, 3, "props-toplabels");
-		if (userAdd) {
+		if (userAdd)
 			permTable.setWidget(1, 0, suggestBox);
-			suggestBox.setLimit(10);
-			suggestBox.addEventHandler(new SuggestionHandler() {
-
-				public void onSuggestionSelected(SuggestionEvent event) {
-					UserSuggestion sug = (UserSuggestion) event.getSelectedSuggestion();
-					selectedUser = sug.getUserDTO();
-					GWT.log(selectedUser + "", null);
-				}
-
-			});
-		} else
+		else
 			permTable.setWidget(1, 0, groupBox);
 		permTable.setWidget(1, 1, read);
 		permTable.setWidget(1, 2, write);
@@ -135,27 +121,28 @@ public class PermissionsAddDialog extends DialogBox {
 	}
 
 	private void addPermission() {
-		PermissionDTO perm = new PermissionDTO();
+		PermissionHolder perm = new PermissionHolder();
 		if (userAdd) {
 			//TODO: check username when it is available
-			for(PermissionDTO p : permList.permissions)
-				if (selectedUser.getUsername().equals(p.getUser().getUsername())){
+			selectedUser = suggestBox.getText();
+			for(PermissionHolder p : permList.permissions)
+				if (selectedUser.equals(p.getUser())){
 					GSS.get().displayError("User already exists");
 					return;
 				}
 			perm.setUser(selectedUser);
 		} else {
-			Long groupId = Long.valueOf(groupBox.getValue(groupBox.getSelectedIndex()));
-			GroupDTO selected = null;
-			for (GroupDTO g : groups)
-				if (g.getId().equals(groupId))
+			String groupId = groupBox.getValue(groupBox.getSelectedIndex());
+			GroupResource selected = null;
+			for (GroupResource g : groups)
+				if (g.getName().equals(groupId))
 					selected = g;
-			for(PermissionDTO p : permList.permissions)
+			for(PermissionHolder p : permList.permissions)
 				if (selected.equals(p.getGroup())){
 					GSS.get().displayError("Group already exists");
 					return;
 				}
-			perm.setGroup(selected);
+			perm.setGroup(selected.getName());
 		}
 		boolean readValue = read.isChecked();
 		boolean writeValue = write.isChecked();
diff --git a/gss/src/gr/ebs/gss/client/PermissionsList.java b/gss/src/gr/ebs/gss/client/PermissionsList.java
index d563809..322636e 100644
--- a/gss/src/gr/ebs/gss/client/PermissionsList.java
+++ b/gss/src/gr/ebs/gss/client/PermissionsList.java
@@ -19,9 +19,9 @@
 package gr.ebs.gss.client;
 
 import gr.ebs.gss.client.FilePropertiesDialog.Images;
-import gr.ebs.gss.client.domain.PermissionDTO;
-import gr.ebs.gss.client.domain.UserDTO;
+import gr.ebs.gss.client.rest.resource.PermissionHolder;
 
+import java.util.HashSet;
 import java.util.Set;
 
 import com.google.gwt.user.client.ui.CheckBox;
@@ -42,19 +42,20 @@ public class PermissionsList extends Composite {
 
 	int selectedRow = -1;
 	int permissionCount=-1;
-	Set permissions = null;
+	Set permissions = null;
 	final Images images;
 	final VerticalPanel permPanel = new VerticalPanel();
 	final FlexTable permTable = new FlexTable();
-	final UserDTO owner;
-	PermissionDTO toRemove = null;
+	final String owner;
+	PermissionHolder toRemove = null;
 	private boolean hasChanges = false;
 
 
-	public PermissionsList(final Images images, Set permissions, UserDTO owner){
+	public PermissionsList(final Images images, Set permissions, String owner){
 		this.images = images;
 		this.owner = owner;
-		this.permissions = permissions;
+		this.permissions =  new HashSet();
+		this.permissions.addAll(permissions);
 		permTable.setText(0, 0, "Users/Groups");
 		permTable.setText(0, 1, "Read");
 		permTable.setText(0, 2, "Write");
@@ -81,7 +82,7 @@ public class PermissionsList extends Composite {
 			permissions.remove(toRemove);
 			toRemove = null;
 		}
-		for(final PermissionDTO dto : permissions){
+		for(final PermissionHolder dto : permissions){
 
 			PushButton removeButton = new PushButton(images.delete().createImage(), new ClickListener() {
 
@@ -93,20 +94,20 @@ public class PermissionsList extends Composite {
 			});
 
 			if(dto.getUser() !=null)
-				if(dto.getUser().getId()!=null && dto.getUser().getId().equals(owner.getId())){
+				if(dto.getUser()!=null && dto.getUser().equals(owner)){
 					permTable.setHTML(i, 0, "" + images.permUser().getHTML() + " Owner");
 					removeButton.setVisible(false);
 				}
 				else
-					permTable.setHTML(i, 0, "" + images.permUser().getHTML() + " "+dto.getUser().getUsername()+"");
+					permTable.setHTML(i, 0, "" + images.permUser().getHTML() + " "+dto.getUser()+"");
 			else if(dto.getGroup() != null)
-				permTable.setHTML(i, 0, "" + images.permGroup().getHTML() + " "+dto.getGroup().getName()+"");
+				permTable.setHTML(i, 0, "" + images.permGroup().getHTML() + " "+dto.getGroup()+"");
 			CheckBox read = new CheckBox();
-			read.setChecked(dto.hasRead());
+			read.setChecked(dto.isRead());
 			CheckBox write = new CheckBox();
-			write.setChecked(dto.hasWrite());
+			write.setChecked(dto.isWrite());
 			CheckBox modify = new CheckBox();
-			modify.setChecked(dto.hasModifyACL());
+			modify.setChecked(dto.isModifyACL());
 			permTable.setWidget(i, 1, read);
 			permTable.setWidget(i, 2, write);
 			permTable.setWidget(i, 3, modify);
@@ -125,13 +126,13 @@ public class PermissionsList extends Composite {
 
 	public void updatePermissionsAccordingToInput(){
 		int i=1;
-		for(PermissionDTO dto : permissions){
-			if(dto.getId() == null)
-				hasChanges =true;
+		for(PermissionHolder dto : permissions){
+			/*if(dto.getId() == null)
+				hasChanges =true;*/
 			CheckBox r = (CheckBox) permTable.getWidget(i, 1);
 			CheckBox w = (CheckBox) permTable.getWidget(i, 2);
 			CheckBox m = (CheckBox) permTable.getWidget(i, 3);
-			if(dto.getRead() != r.isChecked() || dto.getWrite() != w.isChecked() || dto.getModifyACL() != m.isChecked())
+			if(dto.isRead() != r.isChecked() || dto.isWrite() != w.isChecked() || dto.isModifyACL() != m.isChecked())
 				hasChanges = true;
 			dto.setRead(r.isChecked());
 			dto.setWrite(w.isChecked());
@@ -141,4 +142,15 @@ public class PermissionsList extends Composite {
 	}
 
 
+	/**
+	 * Retrieve the permissions.
+	 *
+	 * @return the permissions
+	 */
+	public Set getPermissions() {
+		return permissions;
+	}
+
+
+
 }
diff --git a/gss/src/gr/ebs/gss/client/PopupTree.java b/gss/src/gr/ebs/gss/client/PopupTree.java
index 1b99b53..35a7866 100644
--- a/gss/src/gr/ebs/gss/client/PopupTree.java
+++ b/gss/src/gr/ebs/gss/client/PopupTree.java
@@ -19,10 +19,10 @@
 package gr.ebs.gss.client;
 
 import gr.ebs.gss.client.Folders.Images;
+import gr.ebs.gss.client.dnd.DnDTreeItem;
 import gr.ebs.gss.client.domain.FolderDTO;
 import gr.ebs.gss.client.domain.UserDTO;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.Event;
 import com.google.gwt.user.client.ui.KeyboardListener;
@@ -56,20 +56,26 @@ public class PopupTree extends Tree {
 
 			public void onTreeItemSelected(TreeItem item) {
 				processItemSelected(item, true);
+
 			}
 
 			public void onTreeItemStateChanged(TreeItem item) {
-				if (!item.getState()){
-					GWT.log("Returning", null);
+				boolean shallUpdate = item instanceof DnDTreeItem && ((DnDTreeItem)item).needExpanding();
+				if(item.getParentItem() != null && !item.getParentItem().getState())
+					return;
+				if (!item.getState() &&!shallUpdate )
 					return;
-				}
-				GSS.get().getFolders().update(GSS.get().getCurrentUser().getId(), item);
+				GSS.get().getFolders().update(item);
 			}
 		});
+		//DOM.setStyleAttribute(getElement(), "position", "static");
+
 	}
 
 
 	public void onBrowserEvent(Event event) {
+		if (DOM.eventGetType(event) == Event.ONCLICK) return;
+
 		switch (DOM.eventGetType(event)) {
 			case Event.ONKEYDOWN:
 				int key = DOM.eventGetKeyCode(event);
@@ -112,18 +118,18 @@ public class PopupTree extends Tree {
 	}
 
 	void processItemSelected(TreeItem item, boolean fireEvents) {
-		if(!GSS.get().isFileListShowing()){
-			if(GSS.get().getCurrentSelection() == null || !GSS.get().getCurrentSelection().equals(item.getUserObject()))
-				GSS.get().setCurrentSelection(item.getUserObject());
+
+		if(GSS.get().getCurrentSelection() == null || !GSS.get().getCurrentSelection().equals(item.getUserObject()))
+			GSS.get().setCurrentSelection(item.getUserObject());
+		if(!GSS.get().isFileListShowing())
 			GSS.get().showFileList();
-		}
 
 		//refresh Others Shared Node
 		if(GSS.get().getFolders().isOthersShared(item))
-			GSS.get().getFolders().update(GSS.get().getCurrentUser().getId(), item);
+			GSS.get().getFolders().update(item);
 		//refresh Others Shared User Node
-		else if(GSS.get().getFolders().isOthersSharedItem(item) && item.getUserObject() instanceof UserDTO)
-			GSS.get().getFolders().update(GSS.get().getCurrentUser().getId(), item);
+		//else if(GSS.get().getFolders().isOthersSharedItem(item) && item.getUserObject() instanceof UserDTO)
+			//GSS.get().getFolders().update(item);
 
 		if (!item.equals(treeSelectedItem))
 			processSelection(item);
@@ -142,6 +148,7 @@ public class PopupTree extends Tree {
 		if (treeSelectedItem != null)
 			treeSelectedItem.getWidget().removeStyleName("gss-SelectedRow");
 		treeSelectedItem = null;
+		setSelectedItem(null, true);
 		GSS.get().setCurrentSelection(null);
 	}
 
@@ -151,8 +158,13 @@ public class PopupTree extends Tree {
 			treeSelectedItem.getWidget().removeStyleName("gss-SelectedRow");
 
 			treeSelectedItem = null;
+			setSelectedItem(null, true);
 		}
 		treeSelectedItem = item;
+		setSelectedItem(item, true);
+		//ensureSelectedItemVisible();
+		if(((DnDTreeItem)item).getFolderResource() != null)
+			GSS.get().setCurrentSelection(((DnDTreeItem)item).getFolderResource());
 		if (item.getUserObject() instanceof FolderDTO)
 			GSS.get().setCurrentSelection(item.getUserObject());
 		else if(item.getUserObject() instanceof UserDTO)
@@ -161,7 +173,7 @@ public class PopupTree extends Tree {
 			GSS.get().setCurrentSelection(null);
 		item.getWidget().addStyleName("gss-SelectedRow");
 		//if(GSS.get().getFolders().isFileItem(item)||GSS.get().getFolders().isTrashItem(item)||GSS.get().getFolders().isMySharedItem(item))
-			GSS.get().showFileList();
+			GSS.get().showFileList(true);
 	}
 
 	/**
diff --git a/gss/src/gr/ebs/gss/client/SearchResults.java b/gss/src/gr/ebs/gss/client/SearchResults.java
index eaf13bd..47d1b84 100644
--- a/gss/src/gr/ebs/gss/client/SearchResults.java
+++ b/gss/src/gr/ebs/gss/client/SearchResults.java
@@ -19,9 +19,11 @@
 package gr.ebs.gss.client;
 
 import gr.ebs.gss.client.dnd.DnDFocusPanel;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteGet;
+import gr.ebs.gss.client.rest.ExecuteMultipleHead;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.SearchResource;
+import gr.ebs.gss.client.rest.resource.UserResource;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -29,12 +31,12 @@ import java.util.Comparator;
 import java.util.List;
 
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.http.client.URL;
 import com.google.gwt.i18n.client.DateTimeFormat;
 import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.Event;
 import com.google.gwt.user.client.IncrementalCommand;
-import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.ClickListener;
 import com.google.gwt.user.client.ui.Composite;
@@ -101,7 +103,7 @@ public class SearchResults extends Composite implements TableListener, ClickList
 	/**
 	 * The table widget with the file list.
 	 */
-	private Grid table;// = new Grid(GSSService.VISIBLE_FILE_COUNT + 1, 8);
+	private Grid table;// = new Grid(GSS.VISIBLE_FILE_COUNT + 1, 8);
 
 	/**
 	 * The navigation bar for paginating the results.
@@ -116,12 +118,8 @@ public class SearchResults extends Composite implements TableListener, ClickList
 	/**
 	 * A cache of the files in the list.
 	 */
-	private List files;
+	private List files;
 
-	/**
-	 * A proxy handler for the remote GSS service.
-	 */
-	private final GSSServiceAsync service;
 
 	/**
 	 * The widget's image bundle.
@@ -156,7 +154,7 @@ public class SearchResults extends Composite implements TableListener, ClickList
 	 */
 	public SearchResults(final Images _images) {
 		images = _images;
-		table = new Grid(GSSService.VISIBLE_FILE_COUNT + 1, 8){
+		table = new Grid(GSS.VISIBLE_FILE_COUNT + 1, 8){
 			public void onBrowserEvent(Event event) {
 				if (files == null || files.size() == 0)
 					return;
@@ -190,8 +188,6 @@ public class SearchResults extends Composite implements TableListener, ClickList
 		contextMenu = new DnDFocusPanel(new HTML(images.fileContextMenu().getHTML()));
 		contextMenu.addClickListener(new FileContextMenu(images, false));
 		GSS.get().getDragController().makeDraggable(contextMenu);
-		// Set up the service proxy
-		service = GSS.get().getRemoteService();
 
 		// Setup the table.
 		table.setCellSpacing(0);
@@ -235,15 +231,15 @@ public class SearchResults extends Composite implements TableListener, ClickList
 		if (sender == nextButton) {
 			// Move forward a page.
 			clearSelectedRows();
-			startIndex += GSSService.VISIBLE_FILE_COUNT;
+			startIndex += GSS.VISIBLE_FILE_COUNT;
 			if (startIndex >= folderFileCount)
-				startIndex -= GSSService.VISIBLE_FILE_COUNT;
+				startIndex -= GSS.VISIBLE_FILE_COUNT;
 			else
 				update();
 		} else if (sender == prevButton) {
 			clearSelectedRows();
 			// Move back a page.
-			startIndex -= GSSService.VISIBLE_FILE_COUNT;
+			startIndex -= GSS.VISIBLE_FILE_COUNT;
 			if (startIndex < 0)
 				startIndex = 0;
 			else
@@ -259,10 +255,10 @@ public class SearchResults extends Composite implements TableListener, ClickList
 	 * @return true if the retrieval was successful
 	 */
 	protected boolean fetchRootFolder() {
-		UserDTO user = GSS.get().getCurrentUser();
+		UserResource user = GSS.get().getCurrentUserResource();
 		if (user == null)
 			return !DONE;
-		updateFileCache(user.getId(), "");
+		updateFileCache("");
 		return DONE;
 	}
 
@@ -287,7 +283,7 @@ public class SearchResults extends Composite implements TableListener, ClickList
 					styleRow(i, true);
 				}
 				GSS.get().setCurrentSelection(getSelectedFiles());
-				contextMenu.setFiles(getSelectedFiles());
+				//contextMenu.setFiles(getSelectedFiles());
 				table.setWidget(row, 0, contextMenu);
 			} else if (row != -1 && row == firstShift) {
 				selectedRows.add(row);
@@ -304,7 +300,7 @@ public class SearchResults extends Composite implements TableListener, ClickList
 				}
 				GSS.get().setCurrentSelection(getSelectedFiles());
 				table.setWidget(row, 0, contextMenu);
-				contextMenu.setFiles(getSelectedFiles());
+				//contextMenu.setFiles(getSelectedFiles());
 			}
 
 		} else if (row > 0)
@@ -395,7 +391,7 @@ public class SearchResults extends Composite implements TableListener, ClickList
 		table.getRowFormatter().setStyleName(0, "gss-ListHeader");
 
 		// Initialize the rest of the rows.
-		for (int i = 1; i < GSSService.VISIBLE_FILE_COUNT + 1; ++i) {
+		for (int i = 1; i < GSS.VISIBLE_FILE_COUNT + 1; ++i) {
 			table.setText(i, 0, "");
 			table.setText(i, 1, "");
 			table.setText(i, 2, "");
@@ -447,7 +443,7 @@ public class SearchResults extends Composite implements TableListener, ClickList
 				GSS.get().setCurrentSelection(files.get(selectedRows.get(0)));
 			else
 				GSS.get().setCurrentSelection(getSelectedFiles());
-			contextMenu.setFiles(getSelectedFiles());
+			//contextMenu.setFiles(getSelectedFiles());
 			table.setWidget(row + 1, 0, contextMenu);
 
 		}
@@ -467,8 +463,8 @@ public class SearchResults extends Composite implements TableListener, ClickList
 		*/
 	}
 
-	public List getSelectedFiles() {
-		List result = new ArrayList();
+	public List getSelectedFiles() {
+		List result = new ArrayList();
 		for (int i : selectedRows)
 			result.add(files.get(i));
 		return result;
@@ -494,7 +490,7 @@ public class SearchResults extends Composite implements TableListener, ClickList
 	 */
 	void update() {
 		int count = folderFileCount;
-		int max = startIndex + GSSService.VISIBLE_FILE_COUNT;
+		int max = startIndex + GSS.VISIBLE_FILE_COUNT;
 		if (max > count)
 			max = count;
 
@@ -502,18 +498,18 @@ public class SearchResults extends Composite implements TableListener, ClickList
 			countLabel.setText("no files");
 			prevButton.setVisible(false);
 			nextButton.setVisible(false);
-		} else if (folderFileCount < GSSService.VISIBLE_FILE_COUNT) {
+		} else if (folderFileCount < GSS.VISIBLE_FILE_COUNT) {
 			countLabel.setText(folderFileCount + " files");
 			prevButton.setVisible(false);
 			nextButton.setVisible(false);
 		} else {
 			countLabel.setText("" + (startIndex + 1) + " - " + max + " of " + count + " files");
 			prevButton.setVisible(startIndex != 0);
-			nextButton.setVisible(startIndex + GSSService.VISIBLE_FILE_COUNT < count);
+			nextButton.setVisible(startIndex + GSS.VISIBLE_FILE_COUNT < count);
 		}
 		// Show the selected files.
 		int i = 1;
-		for (; i < GSSService.VISIBLE_FILE_COUNT + 1; ++i) {
+		for (; i < GSS.VISIBLE_FILE_COUNT + 1; ++i) {
 			// Don't read past the end.
 			// if (i > folderFileCount)
 			// break;
@@ -522,20 +518,20 @@ public class SearchResults extends Composite implements TableListener, ClickList
 			// Add a new row to the table, then set each of its columns to the
 			// proper values.
 			table.setWidget(i, 0, images.document().createImage());
-			FileHeaderDTO fileHeader = files.get(startIndex + i - 1);
+			FileResource fileHeader = files.get(startIndex + i - 1);
 			table.getRowFormatter().addStyleName(i, "gss-fileRow");
 			table.setHTML(i, 1, fileHeader.getName());
-			table.setText(i, 2, fileHeader.getOwner().getName());
+			table.setText(i, 2, fileHeader.getOwner());
 			table.setText(i, 3, fileHeader.getPath());
 			table.setText(i, 4, String.valueOf(fileHeader.getVersion()));
 			table.setText(i, 5, String.valueOf(fileHeader.getFileSizeAsString()));
 			final DateTimeFormat formatter = DateTimeFormat.getFormat("d/M/yyyy");
-			table.setText(i, 6, formatter.format(fileHeader.getAuditInfo().getCreationDate()));
+			table.setText(i, 6, formatter.format(fileHeader.getCreationDate()));
 
 		}
 
 		// Clear any remaining slots.
-		for (; i < GSSService.VISIBLE_FILE_COUNT + 1; ++i) {
+		for (; i < GSS.VISIBLE_FILE_COUNT + 1; ++i) {
 			table.setHTML(i, 0, " ");
 			table.setHTML(i, 1, " ");
 			table.setHTML(i, 2, " ");
@@ -579,7 +575,7 @@ public class SearchResults extends Composite implements TableListener, ClickList
 	 *
 	 * @param userId the ID of the current user
 	 */
-	public void updateFileCache(final Long userId, String query) {
+	public void updateFileCache( String query) {
 		clearSelectedRows();
 		sortingProperty = "name";
 		sortingType = true;
@@ -592,10 +588,47 @@ public class SearchResults extends Composite implements TableListener, ClickList
 			GSS.get().hideLoadingIndicator();
 		} else{
 			searchResults.setHTML("Search results for " + query);
-		service.searchFiles(userId, query, new AsyncCallback() {
+			ExecuteGet eg = new ExecuteGet(SearchResource.class, GSS.GSS_REST_PATH+"search/"+URL.encodeComponent(query)){
+
+				@Override
+				public void onComplete() {
+					SearchResource s = getResult();
+					ExecuteMultipleHead ef = new ExecuteMultipleHead(FileResource.class, s.getFiles().toArray(new String[0])){
+
+						@Override
+						public void onComplete() {
+							setFiles(getResult());
+							update();
+						}
+
+						public void onError(String p, Throwable throwable) {
+							// TODO Auto-generated method stub
+
+						}
+
+
+						public void onError(Throwable t) {
+							// TODO Auto-generated method stub
+
+						}
+
+					};
+					DeferredCommand.addCommand(ef);
+				}
+
+				public void onError(Throwable t) {
+					GSS.get().displayError("Unable to perform search:"+t.getMessage());
+					updateFileCache("");
+				}
+
+			};
+			DeferredCommand.addCommand(eg);
+		}
+		/*
+			service.searchFiles(userId, query, new AsyncCallback() {
 
 			public void onSuccess(final Object result) {
-				final List f = (List) result;
+				final List f = (List) result;
 				// GWT.log(f[0].toString(), null);
 				setFiles(f);
 				update();
@@ -612,20 +645,20 @@ public class SearchResults extends Composite implements TableListener, ClickList
 			}
 
 		});
-		}
+		*/
 	}
 
 	/**
 	 * Fill the file cache with data.
 	 *
 	 * @param _files
-	 * @param files the files to set
+	 * @param filePaths the files to set
 	 */
-	void setFiles(final List _files) {
+	void setFiles(final List _files) {
 		files = _files;
-		Collections.sort(files, new Comparator() {
+		Collections.sort(files, new Comparator() {
 
-			public int compare(FileHeaderDTO arg0, FileHeaderDTO arg1) {
+			public int compare(FileResource arg0, FileResource arg1) {
 				return arg0.getName().compareTo(arg1.getName());
 
 			}
@@ -646,23 +679,23 @@ public class SearchResults extends Composite implements TableListener, ClickList
 		clearSelectedRows();
 		if (files == null || files.size() == 0)
 			return;
-		Collections.sort(files, new Comparator() {
+		Collections.sort(files, new Comparator() {
 
-			public int compare(FileHeaderDTO arg0, FileHeaderDTO arg1) {
+			public int compare(FileResource arg0, FileResource arg1) {
 				if (sortingType)
 					if (sortProperty.equals("version")) {
 						versionLabel.setHTML("Version " + images.desc().getHTML());
 						return new Integer(arg0.getVersion()).compareTo(new Integer(arg1.getVersion()));
 					} else if (sortProperty.equals("owner")) {
 						ownerLabel.setHTML("Owner " + images.desc().getHTML());
-						GWT.log(arg0.getOwner().getName() + "/" + arg1.getOwner().getName(), null);
-						return arg0.getOwner().getName().compareTo(arg1.getOwner().getName());
+						GWT.log(arg0.getOwner() + "/" + arg1.getOwner(), null);
+						return arg0.getOwner().compareTo(arg1.getOwner());
 					} else if (sortProperty.equals("date")) {
 						dateLabel.setHTML("Date " + images.desc().getHTML());
-						return arg0.getAuditInfo().getCreationDate().compareTo(arg1.getAuditInfo().getCreationDate());
+						return arg0.getCreationDate().compareTo(arg1.getCreationDate());
 					} else if (sortProperty.equals("size")) {
 						sizeLabel.setHTML("Size " + images.desc().getHTML());
-						return new Long(arg0.getFileSize()).compareTo(new Long(arg1.getFileSize()));
+						return new Long(arg0.getContentLength()).compareTo(new Long(arg1.getContentLength()));
 					} else if (sortProperty.equals("name")) {
 						nameLabel.setHTML("Name " + images.desc().getHTML());
 						return arg0.getName().compareTo(arg1.getName());
@@ -678,13 +711,13 @@ public class SearchResults extends Composite implements TableListener, ClickList
 					return new Integer(arg1.getVersion()).compareTo(new Integer(arg0.getVersion()));
 				} else if (sortProperty.equals("owner")) {
 					ownerLabel.setHTML("Owner " + images.asc().getHTML());
-					return arg1.getOwner().getName().compareTo(arg0.getOwner().getName());
+					return arg1.getOwner().compareTo(arg0.getOwner());
 				} else if (sortProperty.equals("date")) {
 					dateLabel.setHTML("Date " + images.asc().getHTML());
-					return arg1.getAuditInfo().getCreationDate().compareTo(arg0.getAuditInfo().getCreationDate());
+					return arg1.getCreationDate().compareTo(arg0.getCreationDate());
 				} else if (sortProperty.equals("size")) {
 					sizeLabel.setHTML("Size " + images.asc().getHTML());
-					return new Long(arg1.getFileSize()).compareTo(new Long(arg0.getFileSize()));
+					return new Long(arg1.getContentLength()).compareTo(new Long(arg0.getContentLength()));
 				} else if (sortProperty.equals("name")) {
 					nameLabel.setHTML("Name " + images.asc().getHTML());
 					return arg1.getName().compareTo(arg0.getName());
@@ -739,7 +772,7 @@ public class SearchResults extends Composite implements TableListener, ClickList
 		}
 		selectedRows.clear();
 		Object sel = GSS.get().getCurrentSelection();
-		if (sel instanceof FileHeaderDTO || sel instanceof List)
+		if (sel instanceof FileResource || sel instanceof List)
 			GSS.get().setCurrentSelection(null);
 	}
 
@@ -760,11 +793,11 @@ public class SearchResults extends Composite implements TableListener, ClickList
 		int count = folderFileCount;
 		if (count == 0)
 			return;
-		int max = startIndex + GSSService.VISIBLE_FILE_COUNT;
+		int max = startIndex + GSS.VISIBLE_FILE_COUNT;
 		if (max > count)
 			max = count;
 		int i = 1;
-		for (; i < GSSService.VISIBLE_FILE_COUNT + 1; ++i) {
+		for (; i < GSS.VISIBLE_FILE_COUNT + 1; ++i) {
 			// Don't read past the end.
 			// if (i > folderFileCount)
 			// break;
@@ -774,7 +807,7 @@ public class SearchResults extends Composite implements TableListener, ClickList
 			styleRow(i - 1, true);
 		}
 		GSS.get().setCurrentSelection(getSelectedFiles());
-		contextMenu.setFiles(getSelectedFiles());
+		//contextMenu.setFiles(getSelectedFiles());
 		table.setWidget(i - 1, 0, contextMenu);
 
 	}
diff --git a/gss/src/gr/ebs/gss/client/ServerSuggestOracle.java b/gss/src/gr/ebs/gss/client/ServerSuggestOracle.java
deleted file mode 100644
index 12dd547..0000000
--- a/gss/src/gr/ebs/gss/client/ServerSuggestOracle.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright 2008, 2009 Electronic Business Systems Ltd.
- *
- * This file is part of GSS.
- *
- * GSS is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GSS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GSS.  If not, see .
- */
-package gr.ebs.gss.client;
-
-
-/**
- * @author kman
- *
- */
-import gr.ebs.gss.client.domain.UserDTO;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.ui.SuggestOracle;
-
-/**
- * A SuggestOracle that uses a server side source of suggestions. Instances of this class can not
- * be shared between SuggestBox instances.
- *
- * @author amoffat Alex Moffat
- */
-public class ServerSuggestOracle extends SuggestOracle {
-    private GSSServiceAsync namesService = (GSSServiceAsync) GWT.create(GSSService.class);
-    /**
-     * Class to hold a response from the server.
-     */
-    private static class ServerResponse {
-
-        /**
-         * Request made by the SuggestBox.
-         */
-        private final Request request;
-
-        /**
-         * The number of suggestions the server was asked for
-         */
-        private final int serverSuggestionsLimit;
-
-        /**
-         * Suggestions returned by the server in response to the request.
-         */
-        private final List suggestions;
-
-        /**
-         * Create a new instance.
-         *
-         * @param request Request from the SuggestBox.
-         * @param serverSuggestionsLimit The number of suggestions we asked the server for.
-         * @param suggestions The suggestions returned by the server.
-         */
-        private ServerResponse(Request request, int serverSuggestionsLimit, List suggestions) {
-            this.request = request;
-            this.serverSuggestionsLimit = serverSuggestionsLimit;
-            this.suggestions = suggestions;
-        }
-
-        /**
-         * Get the query string that was sent to the server.
-         *
-         * @return The query.
-         */
-        private String getQuery() {
-            return request.getQuery();
-        }
-
-        /**
-         * Does the response include all possible suggestions for the query.
-         *
-         * @return True or false.
-         */
-        private boolean isComplete() {
-            return suggestions.size() <= serverSuggestionsLimit;
-        }
-
-        /**
-         * Filter the suggestions we got back from the server.
-         *
-         * @param query The query string.
-         * @param limit The number of suggestions to return.
-         * @return The suggestions.
-         */
-        public List filter(String query, int limit) {
-
-            List newSuggestions = new ArrayList(limit);
-            int i = 0, s = suggestions.size();
-            while (i < s && !suggestions.get(i).getDisplayString().startsWith(query))
-				++i;
-            while (i < s && newSuggestions.size() < limit && suggestions.get(i).getDisplayString().startsWith(query)) {
-                newSuggestions.add(suggestions.get(i));
-                ++i;
-            }
-            return newSuggestions;
-        }
-    }
-
-    /**
-     * Number of suggestions to request from the server.
-     * Using 75 lets you test the logic that uses the isComplete method. Try using "al" as the initial query
-     */
-//    private static final int numberOfServerSuggestions = 100;
-    private static final int numberOfServerSuggestions = 75;
-
-    /**
-     * The remote service that is the source of names.
-     */
-
-
-    /**
-     * Is there a request in progress
-     */
-    private boolean requestInProgress = false;
-
-    /**
-     * The most recent request made by the client.
-     */
-    private Request mostRecentClientRequest = null;
-
-    /**
-     * The most recent response from the server.
-     */
-    private ServerResponse mostRecentServerResponse = null;
-
-    /**
-     * Create a new instance.
-     */
-    public ServerSuggestOracle() {
-
-    }
-
-    /**
-     * Called by the SuggestBox to get some suggestions.
-     *
-     * @param request The request.
-     * @param callback The callback to call with the suggestions.
-     */
-    public void requestSuggestions(final Request request, final Callback callback) {
-        // Record this request as the most recent one.
-        mostRecentClientRequest = request;
-        // If there is not currently a request in progress return some suggestions. If there is a request in progress
-        // suggestions will be returned when it completes.
-        if (!requestInProgress)
-			returnSuggestions(callback);
-    }
-
-    /**
-     * Return some suggestions to the SuggestBox. At this point we know that there is no call to the server currently in
-     * progress and we try to satisfy the request from the most recent results from the server before we call the server.
-     *
-     * @param callback The callback.
-     */
-    private void returnSuggestions(Callback callback) {
-        // For single character queries return an empty list.
-        final String mostRecentQuery = mostRecentClientRequest.getQuery();
-        if (mostRecentQuery.length() == 1) {
-            callback.onSuggestionsReady(mostRecentClientRequest,
-                    new Response(Collections.emptyList()));
-            return;
-        }
-        // If we have a response from the server, and it includes all the possible suggestions for its request, and
-        // that request is a superset of the request we're trying to satisfy now then use the server results, otherwise
-        // ask the server for some suggestions.
-        if (mostRecentServerResponse != null) {
-            if (mostRecentQuery.equals(mostRecentServerResponse.getQuery())) {
-                Response resp =
-                        new Response(mostRecentServerResponse.filter(mostRecentClientRequest.getQuery(),
-                                mostRecentClientRequest.getLimit()));
-                callback.onSuggestionsReady(mostRecentClientRequest, resp);
-            } else if (mostRecentServerResponse.isComplete() &&
-                    mostRecentQuery.startsWith(mostRecentServerResponse.getQuery())) {
-                Response resp =
-                        new Response(mostRecentServerResponse.filter(mostRecentClientRequest.getQuery(),
-                                mostRecentClientRequest.getLimit()));
-                callback.onSuggestionsReady(mostRecentClientRequest, resp);
-            } else
-				makeRequest(mostRecentClientRequest, callback);
-        } else
-			makeRequest(mostRecentClientRequest, callback);
-    }
-
-    /**
-     * Send a request to the server.
-     *
-     * @param request The request.
-     * @param callback The callback to call when the request returns.
-     */
-    private void makeRequest(final Request request, final Callback callback) {
-        requestInProgress = true;
-        GSS.get().getRemoteService().getUsersByUserNameLike(request.getQuery(), new AsyncCallback() {
-            public void onFailure(Throwable caught) {
-            	GWT.log("skata", caught);
-                requestInProgress = false;
-            }
-            public void onSuccess(Object result) {
-            	GWT.log("make", null);
-            	List res = new ArrayList();
-            	List users = (List)result;
-            	for(UserDTO u : users)
-            		res.add(new UserSuggestion(u));
-            	requestInProgress = false;
-                mostRecentServerResponse = new ServerResponse(request, numberOfServerSuggestions, res);
-                ServerSuggestOracle.this.returnSuggestions(callback);
-            }
-        });
-    }
-}
\ No newline at end of file
diff --git a/gss/src/gr/ebs/gss/client/StatusPanel.java b/gss/src/gr/ebs/gss/client/StatusPanel.java
index 451dee6..513f8c6 100644
--- a/gss/src/gr/ebs/gss/client/StatusPanel.java
+++ b/gss/src/gr/ebs/gss/client/StatusPanel.java
@@ -18,14 +18,13 @@
  */
 package gr.ebs.gss.client;
 
-import gr.ebs.gss.client.domain.StatsDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteGet;
+import gr.ebs.gss.client.rest.resource.QuotaHolder;
+import gr.ebs.gss.client.rest.resource.UserResource;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.IncrementalCommand;
-import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.HTML;
@@ -100,6 +99,7 @@ public class StatusPanel extends Composite {
 		outer.setStyleName("statusbar-inner");
 
 		initWidget(outer);
+
 		DeferredCommand.addCommand(new IncrementalCommand() {
 			public boolean execute() {
 				return updateStats();
@@ -108,16 +108,13 @@ public class StatusPanel extends Composite {
 	}
 
 	public boolean updateStats() {
-		UserDTO user = GSS.get().getCurrentUser();
-		if (user == null || GSS.get().getFolders().getRootItem() == null) return !DONE;
-		Long userId = user.getId();
-
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		service.getUserStatistics(userId, new AsyncCallback() {
 
-			public void onSuccess(final Object result) {
-				final StatsDTO stats = (StatsDTO) result;
+		UserResource userResource = GSS.get().getCurrentUserResource();
+		if (userResource == null || GSS.get().getFolders().getRootItem() == null) return !DONE;
+		ExecuteGet uc = new ExecuteGet(UserResource.class, userResource.getPath()){
+			@Override
+			public void onComplete() {
+				final QuotaHolder stats = getResult().getQuota();
 				fileCountLabel.setHTML(stats.getFileCount() +" total files");
 				fileSizeLabel.setHTML(stats.getFileSizeAsString() + " total size");
 				long pc = stats.percentOfFreeSpace();
@@ -127,19 +124,14 @@ public class StatusPanel extends Composite {
 					quotaLabel.setHTML(images.yellowSize().getHTML()+" "+stats.getQuotaLeftAsString() +" free");
 				else
 					quotaLabel.setHTML(images.greenSize().getHTML()+" "+stats.getQuotaLeftAsString() +" free");
-				//sizeImage  = images.yellowSize().createImage();
-				GSS.get().hideLoadingIndicator();
 			}
-
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
+			@Override
+			public void onError(Throwable t) {
+				GSS.get().displayError("Unable to fetch quota:"+t.getMessage());
+				GWT.log("ERR", t);
 			}
-		});
+		};
+		DeferredCommand.addCommand(uc);
 		return DONE;
 
 	}
diff --git a/gss/src/gr/ebs/gss/client/TopPanel.java b/gss/src/gr/ebs/gss/client/TopPanel.java
index 1a14ba0..e35825b 100644
--- a/gss/src/gr/ebs/gss/client/TopPanel.java
+++ b/gss/src/gr/ebs/gss/client/TopPanel.java
@@ -18,7 +18,7 @@
  */
 package gr.ebs.gss.client;
 
-import gr.ebs.gss.client.domain.UserDTO;
+import gr.ebs.gss.client.rest.resource.UserResource;
 
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.DeferredCommand;
@@ -183,7 +183,7 @@ public class TopPanel extends Composite {
 	 * @return true if the work has been carried out successfully
 	 */
 	protected boolean displayUserInfo() {
-		UserDTO user = GSS.get().getCurrentUser();
+		UserResource user = GSS.get().getCurrentUserResource();
 		if (user == null)
 			return !DONE;
 		userInfoLabel.setHTML("" + user.getName() + ", " + user.getUsername() + "");
diff --git a/gss/src/gr/ebs/gss/client/UserAddDialog.java b/gss/src/gr/ebs/gss/client/UserAddDialog.java
index 4c96534..a6505ff 100644
--- a/gss/src/gr/ebs/gss/client/UserAddDialog.java
+++ b/gss/src/gr/ebs/gss/client/UserAddDialog.java
@@ -19,12 +19,12 @@
 package gr.ebs.gss.client;
 
 import gr.ebs.gss.client.Groups.Images;
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecutePost;
+import gr.ebs.gss.client.rest.RestException;
+import gr.ebs.gss.client.rest.resource.GroupResource;
 
 import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.ClickListener;
 import com.google.gwt.user.client.ui.DialogBox;
@@ -33,9 +33,7 @@ import com.google.gwt.user.client.ui.HasHorizontalAlignment;
 import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.KeyboardListener;
 import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.SuggestBox;
-import com.google.gwt.user.client.ui.SuggestionEvent;
-import com.google.gwt.user.client.ui.SuggestionHandler;
+import com.google.gwt.user.client.ui.TextBox;
 import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
 
@@ -44,10 +42,9 @@ import com.google.gwt.user.client.ui.Widget;
  */
 public class UserAddDialog extends DialogBox {
 
-	ServerSuggestOracle suggestOracle = new ServerSuggestOracle();
 
-	SuggestBox suggestBox = new SuggestBox(suggestOracle);
-	UserDTO selectedUser=null;
+	private TextBox suggestBox = new TextBox();
+	String selectedUser=null;
 	Label nameLabel;
 	Label usernameLabel;
 
@@ -71,18 +68,6 @@ public class UserAddDialog extends DialogBox {
 		userTable.addStyleName("gss-permList");
 		userTable.setWidget(0, 0, new Label("Enter Username:"));
 		userTable.getFlexCellFormatter().setStyleName(0, 0, "props-toplabels");
-        suggestBox.setLimit(10);
-        suggestBox.addEventHandler(new SuggestionHandler(){
-
-			public void onSuggestionSelected(SuggestionEvent event) {
-				UserSuggestion sug = (UserSuggestion) event.getSelectedSuggestion();
-				selectedUser = sug.getUserDTO();
-				usernameLabel.setText(selectedUser.getUsername());
-				nameLabel.setText(selectedUser.getName());
-				GWT.log(selectedUser+"", null);
-			}
-
-        });
         userTable.setWidget(0, 1, suggestBox);
         userTable.setWidget(1, 0, new Label("Selected User:"));
         userTable.getFlexCellFormatter().setStyleName(1, 0, "props-toplabels");
@@ -162,8 +147,8 @@ public class UserAddDialog extends DialogBox {
 	 * @param groupName the name of the group to create
 	 */
 	private void addUser() {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		GroupDTO group = (GroupDTO) GSS.get().getCurrentSelection();
+
+		GroupResource group = (GroupResource) GSS.get().getCurrentSelection();
 		if ( group == null ) {
 			GSS.get().displayError("Empty group name!");
 			return;
@@ -172,22 +157,32 @@ public class UserAddDialog extends DialogBox {
 			GSS.get().displayError("No User Selected!");
 			return;
 		}
-		service.addUserToGroup(GSS.get().getCurrentUser().getId(), group.getId(), selectedUser.getId(), new AsyncCallback() {
+		ExecutePost cg = new ExecutePost(group.getPath()+"?name="+selectedUser, "", 201){
 
-			public void onSuccess(final Object result) {
-				GSS.get().getGroups().updateGroups(GSS.get().getCurrentUser().getId());
+			public void onComplete() {
+				GSS.get().getGroups().updateGroups();
 				GSS.get().showUserList();
 			}
-
-			public void onFailure(final Throwable caught) {
-
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				if(t instanceof RestException){
+					int statusCode = ((RestException)t).getHttpStatusCode();
+					if(statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions");
+					else if(statusCode == 404)
+						GSS.get().displayError("User does not exist");
+					else if(statusCode == 409)
+						GSS.get().displayError("A user with the same name already exists");
+					else if(statusCode == 413)
+						GSS.get().displayError("Your quota has been exceeded");
+					else
+						GSS.get().displayError("Unable to add user, status code:"+statusCode);
+				}
 				else
-					GSS.get().displayError(caught.getMessage());
-
+					GSS.get().displayError("System error adding user:"+t.getMessage());
 			}
-		});
+		};
+		DeferredCommand.addCommand(cg);
+
 	}
 }
diff --git a/gss/src/gr/ebs/gss/client/VersionsList.java b/gss/src/gr/ebs/gss/client/VersionsList.java
index 404799b..4dc51fd 100644
--- a/gss/src/gr/ebs/gss/client/VersionsList.java
+++ b/gss/src/gr/ebs/gss/client/VersionsList.java
@@ -19,15 +19,18 @@
 package gr.ebs.gss.client;
 
 import gr.ebs.gss.client.FilePropertiesDialog.Images;
-import gr.ebs.gss.client.domain.FileBodyDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteDelete;
+import gr.ebs.gss.client.rest.RestException;
+import gr.ebs.gss.client.rest.resource.FileResource;
 
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.ui.ClickListener;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.FlexTable;
@@ -45,9 +48,9 @@ public class VersionsList extends Composite {
 
 	int permissionCount = -1;
 
-	List versions = null;
+	List versions = null;
 
-	private List newVersions = null;
+	private List newVersions = null;
 
 	final Images images;
 
@@ -55,14 +58,21 @@ public class VersionsList extends Composite {
 
 	final FlexTable permTable = new FlexTable();
 
-	FileBodyDTO toRemove = null;
+	FileResource toRemove = null;
 
 	FilePropertiesDialog container;
 
-	public VersionsList(FilePropertiesDialog container, final Images images, List versions) {
+	public VersionsList(FilePropertiesDialog container, final Images images, List versions) {
 		this.images = images;
 		this.container = container;
 		this.versions = versions;
+		Collections.sort(versions, new Comparator(){
+
+			public int compare(FileResource o1, FileResource o2) {
+				return o1.getVersion().compareTo(o2.getVersion());
+			}
+
+		});
 		permTable.setText(0, 0, "Version");
 		permTable.setText(0, 1, "Created");
 		permTable.setText(0, 2, "Modified");
@@ -92,7 +102,7 @@ public class VersionsList extends Composite {
 			versions.remove(toRemove);
 			toRemove = null;
 		}
-		for (final FileBodyDTO dto : versions) {
+		for (final FileResource dto : versions) {
 			HTML restoreVersion = new HTML(""+images.restore().getHTML()+"Restore this Version");
 			restoreVersion.addClickListener( new ClickListener() {
 
@@ -102,8 +112,8 @@ public class VersionsList extends Composite {
 			});
 
 			permTable.setHTML(i, 0, "" + dto.getVersion() + "");
-			permTable.setHTML(i, 1, "" + formatDate(dto.getAuditInfo().getCreationDate()) + "");
-			permTable.setHTML(i, 2, "" + formatDate(dto.getAuditInfo().getModificationDate()) + "");
+			permTable.setHTML(i, 1, "" + formatDate(dto.getCreationDate()) + "");
+			permTable.setHTML(i, 2, "" + formatDate(dto.getModificationDate()) + "");
 			permTable.setHTML(i, 3, "" + dto.getFileSizeAsString() + "");
 			String[] link = {"", ""};
 			createDownloadLink(link, dto);
@@ -124,48 +134,41 @@ public class VersionsList extends Composite {
 
 	}
 
-	void createDownloadLink(String[] link, FileBodyDTO dto) {
-		link[0] = "";
+	void createDownloadLink(String[] link, FileResource dto) {
+		link[0] = "";
 		link[1] = "";
 	}
 
-	void removeVersion(final FileBodyDTO version) {
-		GSS.get().getRemoteService().removeVersion(GSS.get().getCurrentUser().getId(), version.getFileHeaderId(), version.getId(), new AsyncCallback() {
+	void removeVersion(final FileResource version) {
+		ExecuteDelete df = new ExecuteDelete(version.getPath()){
 
-			public void onSuccess(final Object result) {
+			public void onComplete() {
 				toRemove = version;
 				updateTable();
-				GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
+				GSS.get().getFileList().updateFileCache(false);
 			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				if(t instanceof RestException){
+					int statusCode = ((RestException)t).getHttpStatusCode();
+					if(statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions");
+					else if(statusCode == 404)
+						GSS.get().displayError("Versions does not exist");
+					else
+						GSS.get().displayError("Unable to remove  version, status code:"+statusCode);
+				}
 				else
-					GSS.get().displayError(caught.getMessage());
+					GSS.get().displayError("System error removing version:"+t.getMessage());
 			}
-		});
+		};
+		DeferredCommand.addCommand(df);
 
 	}
 
-	void restoreVersion(final FileBodyDTO version) {
-		GSS.get().getRemoteService().restoreVersion(GSS.get().getCurrentUser().getId(), version.getFileHeaderId(), version.getId(), new AsyncCallback() {
+	void restoreVersion(final FileResource version) {
 
-			public void onSuccess(final Object result) {
-				GWT.log("RESTORE CALLED", null);
-				container.hide();
-				GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
-			}
-
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-			}
-		});
 
 	}
 
diff --git a/gss/src/gr/ebs/gss/client/clipboard/ClipboardItem.java b/gss/src/gr/ebs/gss/client/clipboard/ClipboardItem.java
index 3433403..d24e1e5 100644
--- a/gss/src/gr/ebs/gss/client/clipboard/ClipboardItem.java
+++ b/gss/src/gr/ebs/gss/client/clipboard/ClipboardItem.java
@@ -18,9 +18,9 @@
  */
 package gr.ebs.gss.client.clipboard;
 
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.UserDTO;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.GroupUserResource;
 
 import java.io.Serializable;
 import java.util.List;
@@ -32,50 +32,50 @@ import java.util.List;
  */
 public class ClipboardItem implements Serializable{
 	private int operation;
-	private FileHeaderDTO file;
-	private FolderDTO folder;
-	private UserDTO user;
-	private List files;
+	private FileResource file;
+	private List files;
+	private FolderResource folderResource;
+	private GroupUserResource user;
 
 	public ClipboardItem(){}
 
-	public ClipboardItem(int operation, List files){
+	public ClipboardItem(int operation, List files){
 		this.operation=operation;
 		this.files = files;
 	}
 
-	public ClipboardItem(int operation, FileHeaderDTO file){
+	public ClipboardItem(int operation, FileResource file){
 		this.operation=operation;
 		this.file = file;
 	}
 
-	public ClipboardItem(int operation, FolderDTO folder){
+	public ClipboardItem(int operation, FolderResource folder){
 		this.operation=operation;
-		this.folder = folder;
+		folderResource = folder;
 	}
-	public ClipboardItem(int operation, UserDTO user){
+	public ClipboardItem(int operation, GroupUserResource user){
 		this.operation=operation;
 		this.user = user;
 	}
 
-	public ClipboardItem(UserDTO user){
+	public ClipboardItem(GroupUserResource user){
 		operation=Clipboard.COPY;
 		this.user = user;
 	}
 
-	public ClipboardItem(List files){
+	public ClipboardItem(List files){
 		operation=Clipboard.COPY;
 		this.files = files;
 	}
 
-	public ClipboardItem(FileHeaderDTO file){
+	public ClipboardItem(FileResource file){
 		operation=Clipboard.COPY;
 		this.file = file;
 	}
 
-	public ClipboardItem(FolderDTO folder){
+	public ClipboardItem(FolderResource folder){
 		operation=Clipboard.COPY;
-		this.folder = folder;
+		folderResource = folder;
 	}
 
 
@@ -86,7 +86,7 @@ public class ClipboardItem implements Serializable{
 	 *
 	 * @return the user
 	 */
-	public UserDTO getUser() {
+	public GroupUserResource getUser() {
 		return user;
 	}
 
@@ -96,7 +96,7 @@ public class ClipboardItem implements Serializable{
 	 *
 	 * @param user the user to set
 	 */
-	public void setUser(UserDTO user) {
+	public void setUser(GroupUserResource user) {
 		this.user = user;
 	}
 
@@ -123,7 +123,7 @@ public class ClipboardItem implements Serializable{
 	 *
 	 * @return the file
 	 */
-	public FileHeaderDTO getFile() {
+	public FileResource getFile() {
 		return file;
 	}
 
@@ -132,27 +132,10 @@ public class ClipboardItem implements Serializable{
 	 *
 	 * @param file the file to set
 	 */
-	public void setFile(FileHeaderDTO file) {
+	public void setFile(FileResource file) {
 		this.file = file;
 	}
 
-	/**
-	 * Retrieve the folder.
-	 *
-	 * @return the folder
-	 */
-	public FolderDTO getFolder() {
-		return folder;
-	}
-
-	/**
-	 * Modify the folder.
-	 *
-	 * @param folder the folder to set
-	 */
-	public void setFolder(FolderDTO folder) {
-		this.folder = folder;
-	}
 
 
 	/**
@@ -160,7 +143,7 @@ public class ClipboardItem implements Serializable{
 	 *
 	 * @return the files
 	 */
-	public List getFiles() {
+	public List getFiles() {
 		return files;
 	}
 
@@ -169,7 +152,7 @@ public class ClipboardItem implements Serializable{
 	 * @return
 	 */
 	public boolean isFileOrFolder(){
-		if( folder!=null || file !=null || files != null)
+		if(  file !=null || files != null || folderResource != null)
 			return true;
 		return false;
 	}
@@ -181,4 +164,25 @@ public class ClipboardItem implements Serializable{
 		return false;
 	}
 
+
+	/**
+	 * Retrieve the folderResource.
+	 *
+	 * @return the folderResource
+	 */
+	public FolderResource getFolderResource() {
+		return folderResource;
+	}
+
+
+	/**
+	 * Modify the folderResource.
+	 *
+	 * @param folderResource the folderResource to set
+	 */
+	public void setFolderResource(FolderResource folderResource) {
+		this.folderResource = folderResource;
+	}
+
+
 }
diff --git a/gss/src/gr/ebs/gss/client/commands/CopyCommand.java b/gss/src/gr/ebs/gss/client/commands/CopyCommand.java
index f49e392..c262972 100644
--- a/gss/src/gr/ebs/gss/client/commands/CopyCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/CopyCommand.java
@@ -20,14 +20,12 @@ package gr.ebs.gss.client.commands;
 
 import gr.ebs.gss.client.GSS;
 import gr.ebs.gss.client.clipboard.ClipboardItem;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.UserDTO;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.GroupUserResource;
 
 import java.util.List;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.ui.PopupPanel;
 /**
@@ -50,23 +48,22 @@ public class CopyCommand implements Command{
 		Object selection = GSS.get().getCurrentSelection();
 		if (selection == null)
 			return;
-		if (selection instanceof FolderDTO) {
-			ClipboardItem clipboardItem = new ClipboardItem((FolderDTO) selection);
+
+		if (selection instanceof FolderResource) {
+			ClipboardItem clipboardItem = new ClipboardItem((FolderResource) selection);
 			GSS.get().getClipboard().setItem(clipboardItem);
-		} else if (selection instanceof FileHeaderDTO) {
-			ClipboardItem clipboardItem = new ClipboardItem((FileHeaderDTO) selection);
+		} else if (selection instanceof FileResource) {
+			ClipboardItem clipboardItem = new ClipboardItem((FileResource) selection);
 			GSS.get().getClipboard().setItem(clipboardItem);
-		} else if (selection instanceof UserDTO) {
-			ClipboardItem clipboardItem = new ClipboardItem((UserDTO) selection);
+		} else if (selection instanceof GroupUserResource) {
+			ClipboardItem clipboardItem = new ClipboardItem((GroupUserResource) selection);
 			GSS.get().getClipboard().setItem(clipboardItem);
-		} else if (selection instanceof GroupDTO) {
-			// no copy for groups
 		}
 		 else if (selection instanceof List){
-			 GWT.log("SELECTION IS A LIST", null);
-			 ClipboardItem clipboardItem = new ClipboardItem((List) selection);
+			 ClipboardItem clipboardItem = new ClipboardItem((List) selection);
 			 GSS.get().getClipboard().setItem(clipboardItem);
 		 }
+
 	}
 
 }
diff --git a/gss/src/gr/ebs/gss/client/commands/CutCommand.java b/gss/src/gr/ebs/gss/client/commands/CutCommand.java
index 9ee81ad..4dd08cf 100644
--- a/gss/src/gr/ebs/gss/client/commands/CutCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/CutCommand.java
@@ -21,10 +21,9 @@ package gr.ebs.gss.client.commands;
 import gr.ebs.gss.client.GSS;
 import gr.ebs.gss.client.clipboard.Clipboard;
 import gr.ebs.gss.client.clipboard.ClipboardItem;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.UserDTO;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.GroupUserResource;
 
 import java.util.List;
 
@@ -53,20 +52,18 @@ public class CutCommand implements Command{
 		if (selection == null)
 			return;
 		GWT.log("selection: " + selection.toString(), null);
-		if (selection instanceof FolderDTO) {
-			ClipboardItem clipboardItem = new ClipboardItem(Clipboard.CUT, (FolderDTO) selection);
+		if (selection instanceof FolderResource) {
+			ClipboardItem clipboardItem = new ClipboardItem(Clipboard.CUT, (FolderResource) selection);
 			GSS.get().getClipboard().setItem(clipboardItem);
-		} else if (selection instanceof FileHeaderDTO) {
-			ClipboardItem clipboardItem = new ClipboardItem(Clipboard.CUT, (FileHeaderDTO) selection);
+		} else if (selection instanceof FileResource) {
+			ClipboardItem clipboardItem = new ClipboardItem(Clipboard.CUT, (FileResource) selection);
 			GSS.get().getClipboard().setItem(clipboardItem);
-		} else if (selection instanceof UserDTO) {
-			ClipboardItem clipboardItem = new ClipboardItem(Clipboard.CUT, (UserDTO) selection);
+		} else if (selection instanceof GroupUserResource) {
+			ClipboardItem clipboardItem = new ClipboardItem(Clipboard.CUT, (GroupUserResource) selection);
 			GSS.get().getClipboard().setItem(clipboardItem);
-		} else if (selection instanceof GroupDTO) {
-			// no copy of groups
 		}
 		else if (selection instanceof List){
-			 ClipboardItem clipboardItem = new ClipboardItem(Clipboard.CUT, (List) selection);
+			 ClipboardItem clipboardItem = new ClipboardItem(Clipboard.CUT, (List) selection);
 			 GSS.get().getClipboard().setItem(clipboardItem);
 		 }
 	}
diff --git a/gss/src/gr/ebs/gss/client/commands/DeleteCommand.java b/gss/src/gr/ebs/gss/client/commands/DeleteCommand.java
index 0a8e7fe..bd35b2e 100644
--- a/gss/src/gr/ebs/gss/client/commands/DeleteCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/DeleteCommand.java
@@ -23,10 +23,10 @@ import gr.ebs.gss.client.DeleteFolderDialog;
 import gr.ebs.gss.client.DeleteGroupDialog;
 import gr.ebs.gss.client.GSS;
 import gr.ebs.gss.client.EditMenu.Images;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.GroupDTO;
 import gr.ebs.gss.client.domain.UserDTO;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.GroupResource;
 
 import java.util.List;
 
@@ -69,15 +69,15 @@ public class DeleteCommand implements Command{
 		if (selection == null)
 			return;
 		GWT.log("selection: " + selection.toString(), null);
-		if (selection instanceof FolderDTO) {
+		if (selection instanceof FolderResource) {
 			DeleteFolderDialog dlg = new DeleteFolderDialog(newImages);
 			dlg.center();
-		} else if (selection instanceof FileHeaderDTO || selection instanceof List) {
+		} else if (selection instanceof FileResource || selection instanceof List) {
 			DeleteFileDialog dlg = new DeleteFileDialog(newImages);
 			dlg.center();
 		} else if (selection instanceof UserDTO) {
 			// TODO implement user deletion
-		} else if (selection instanceof GroupDTO) {
+		} else if (selection instanceof GroupResource) {
 			DeleteGroupDialog dlg = new DeleteGroupDialog(newImages);
 			dlg.center();
 		}
diff --git a/gss/src/gr/ebs/gss/client/commands/DeleteUserOrGroupCommand.java b/gss/src/gr/ebs/gss/client/commands/DeleteUserOrGroupCommand.java
index 68940b6..87127fc 100644
--- a/gss/src/gr/ebs/gss/client/commands/DeleteUserOrGroupCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/DeleteUserOrGroupCommand.java
@@ -22,8 +22,8 @@ import gr.ebs.gss.client.DeleteGroupDialog;
 import gr.ebs.gss.client.DeleteUserDialog;
 import gr.ebs.gss.client.GSS;
 import gr.ebs.gss.client.Groups.Images;
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.UserDTO;
+import gr.ebs.gss.client.rest.resource.GroupResource;
+import gr.ebs.gss.client.rest.resource.GroupUserResource;
 
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.ui.PopupPanel;
@@ -49,9 +49,9 @@ public class DeleteUserOrGroupCommand implements Command{
 	 */
 	public void execute() {
 		containerPanel.hide();
-		if(GSS.get().getCurrentSelection() instanceof GroupDTO)
+		if(GSS.get().getCurrentSelection() instanceof GroupResource)
 			displayNewGroup();
-		else if(GSS.get().getCurrentSelection() instanceof UserDTO)
+		else if(GSS.get().getCurrentSelection() instanceof GroupUserResource)
 			displayNewUser();
 		else
 			GSS.get().displayError("No user or group selected");
diff --git a/gss/src/gr/ebs/gss/client/commands/EmptyTrashCommand.java b/gss/src/gr/ebs/gss/client/commands/EmptyTrashCommand.java
index 1574be3..946e968 100644
--- a/gss/src/gr/ebs/gss/client/commands/EmptyTrashCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/EmptyTrashCommand.java
@@ -19,11 +19,13 @@
 package gr.ebs.gss.client.commands;
 
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.dnd.DnDTreeItem;
+import gr.ebs.gss.client.rest.ExecuteDelete;
+import gr.ebs.gss.client.rest.RestException;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.ui.PopupPanel;
 
 
@@ -43,24 +45,28 @@ public class EmptyTrashCommand implements Command{
 	 */
 	public void execute() {
 		containerPanel.hide();
+		ExecuteDelete df = new ExecuteDelete(((DnDTreeItem)GSS.get().getFolders().getTrashItem()).getTrashResource().getPath()){
 
-		GSS.get().getRemoteService().emptyTrash(GSS.get().getCurrentUser().getId(), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				GSS.get().getFolders().update(GSS.get().getCurrentUser().getId(), GSS.get().getFolders().getTrashItem());
-				GSS.get().getFolders().update(GSS.get().getCurrentUser().getId(), GSS.get().getFolders().getMySharesItem());
-				GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
-				GSS.get().getStatusPanel().updateStats();
+			public void onComplete() {
+				GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
 			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				if(t instanceof RestException){
+					int statusCode = ((RestException)t).getHttpStatusCode();
+					if(statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions");
+					else if(statusCode == 404)
+						GSS.get().displayError("Resource does not exist");
+					else
+						GSS.get().displayError("Unable to empty trash, status code:"+statusCode);
+				}
 				else
-					GSS.get().displayError(caught.getMessage());
+					GSS.get().displayError("System error emptying trash:"+t.getMessage());
 			}
-		});
+		};
+		DeferredCommand.addCommand(df);
 	}
 
 }
diff --git a/gss/src/gr/ebs/gss/client/commands/NewFolderCommand.java b/gss/src/gr/ebs/gss/client/commands/NewFolderCommand.java
index f4233cb..1fd1685 100644
--- a/gss/src/gr/ebs/gss/client/commands/NewFolderCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/NewFolderCommand.java
@@ -21,21 +21,18 @@ package gr.ebs.gss.client.commands;
 import gr.ebs.gss.client.FolderPropertiesDialog;
 import gr.ebs.gss.client.GSS;
 import gr.ebs.gss.client.FileMenu.Images;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.PermissionDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteGet;
+import gr.ebs.gss.client.rest.ExecuteMultipleGet;
+import gr.ebs.gss.client.rest.resource.GroupResource;
+import gr.ebs.gss.client.rest.resource.GroupsResource;
 
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.IncrementalCommand;
-import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.PopupPanel;
 import com.google.gwt.user.client.ui.TreeItem;
 
@@ -48,8 +45,8 @@ import com.google.gwt.user.client.ui.TreeItem;
 public class NewFolderCommand implements Command{
 	private PopupPanel containerPanel;
 	final Images newImages;
-	private Set permissions = null;
-	private List groups = null;
+
+	private List groups = null;
 	/**
 	 * @param _containerPanel
 	 * @param _@param newImages the images of the new folder dialog
@@ -63,7 +60,6 @@ public class NewFolderCommand implements Command{
 	 */
 	public void execute() {
 		containerPanel.hide();
-		getPermissions();
 		getGroups();
 		DeferredCommand.addCommand(new IncrementalCommand() {
 
@@ -82,7 +78,7 @@ public class NewFolderCommand implements Command{
 	}
 
 	private boolean canContinue() {
-		if (permissions == null || groups ==null)
+		if (groups == null)
 			return false;
 		return true;
 	}
@@ -93,55 +89,47 @@ public class NewFolderCommand implements Command{
 			GSS.get().displayError("You have to select the parent folder first");
 			return;
 		}
-		FolderPropertiesDialog dlg = new FolderPropertiesDialog(newImages, true, permissions, groups);
+		FolderPropertiesDialog dlg = new FolderPropertiesDialog(newImages, true,  groups);
 		dlg.center();
 	}
 
-	private void getPermissions() {
 
-		GSS	.get()
-			.getRemoteService()
-			.getFolderPermissions(GSS.get().getCurrentUser().getId(), ((FolderDTO) GSS.get().getFolders().getCurrent().getUserObject()).getId(), new AsyncCallback() {
 
-				public void onFailure(Throwable caught) {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-					else
-						GSS.get().displayError(caught.getMessage());
-					// initialize list object so that we avoid infinite loop
-					permissions = new HashSet();
-				}
+	private void getGroups() {
+		ExecuteGet gg = new ExecuteGet(GroupsResource.class, GSS.get().getCurrentUserResource().getGroupsPath()){
 
-				public void onSuccess(Object result) {
-					permissions = (Set) result;
-				}
+			public void onComplete() {
+				GroupsResource res = getResult();
+				ExecuteMultipleGet ga = new ExecuteMultipleGet(GroupResource.class, res.getGroupPaths().toArray(new String[]{})){
 
-			});
+					public void onComplete() {
+						List groupList = getResult();
+						groups = groupList;
+					}
 
-	}
 
-	private void getGroups() {
+					public void onError(Throwable t) {
+						GWT.log("", t);
+						GSS.get().displayError("Unable to fetch groups");
+						groups = new ArrayList();
+					}
 
-		GSS	.get()
-			.getRemoteService()
-			.getGroups(GSS.get().getCurrentUser().getId(), new AsyncCallback() {
-
-				public void onFailure(Throwable caught) {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-					else
-						GSS.get().displayError(caught.getMessage());
-					// initialize list object so that we avoid infinite loop
-					groups = new ArrayList();
-				}
+					public void onError(String p, Throwable throwable) {
+						GWT.log("Path:"+p, throwable);
+					}
+				};
+				DeferredCommand.addCommand(ga);
+			}
 
-				public void onSuccess(Object result) {
-					groups = (List) result;
-				}
 
-			});
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				GSS.get().displayError("Unable to fetch groups");
+				groups = new ArrayList();
+			}
+		};
+		DeferredCommand.addCommand(gg);
+
 
 	}
 
diff --git a/gss/src/gr/ebs/gss/client/commands/PasteCommand.java b/gss/src/gr/ebs/gss/client/commands/PasteCommand.java
index d6b92a9..8cc4767 100644
--- a/gss/src/gr/ebs/gss/client/commands/PasteCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/PasteCommand.java
@@ -19,21 +19,21 @@
 package gr.ebs.gss.client.commands;
 
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.GSSServiceAsync;
 import gr.ebs.gss.client.clipboard.Clipboard;
 import gr.ebs.gss.client.clipboard.ClipboardItem;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.dnd.DnDTreeItem;
+import gr.ebs.gss.client.rest.ExecutePost;
+import gr.ebs.gss.client.rest.RestException;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
 
 import java.util.ArrayList;
 import java.util.List;
 
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.http.client.URL;
 import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.ui.PopupPanel;
 import com.google.gwt.user.client.ui.TreeItem;
 
@@ -54,237 +54,193 @@ public class PasteCommand implements Command {
 	public void execute() {
 		containerPanel.hide();
 		Object selection = GSS.get().getCurrentSelection();
-		GWT.log("selection: " + selection, null);
-		if (selection == null || GSS.get().getClipboard().getItem() == null)
-			return;
-
-		if (selection instanceof FolderDTO) {
-			ClipboardItem citem = GSS.get().getClipboard().getItem();
-			if (citem.getFile() != null) {
-				if (citem.getOperation() == Clipboard.COPY)
-					copyFile(GSS.get().getCurrentUser().getId(), (FolderDTO) selection, citem.getFile());
-				else if (citem.getOperation() == Clipboard.CUT)
-					moveFile(GSS.get().getCurrentUser().getId(), (FolderDTO) selection, citem.getFile());
-			} else if (citem.getFolder() != null) {
-				if (citem.getOperation() == Clipboard.COPY)
-					copyFolder(GSS.get().getCurrentUser().getId(), (FolderDTO) selection, citem.getFolder());
-				else if (citem.getOperation() == Clipboard.CUT)
-					moveFolder(GSS.get().getCurrentUser().getId(), (FolderDTO) selection, citem.getFolder());
-			} else if (citem.getFiles() != null)
-				if (citem.getOperation() == Clipboard.COPY)
-					copyFiles(GSS.get().getCurrentUser().getId(), (FolderDTO) selection, citem.getFiles());
-				else if (citem.getOperation() == Clipboard.CUT)
-					moveFiles(GSS.get().getCurrentUser().getId(), (FolderDTO) selection, citem.getFiles());
-
-		} else if (selection instanceof FileHeaderDTO) {
-			// TODO do we paste in containing folder?
-		} else if (selection instanceof UserDTO) {
-			// TODO nothing
-		} else if (selection instanceof GroupDTO) {
-			ClipboardItem citem = GSS.get().getClipboard().getItem();
-			if (citem.getUser() != null)
-				addUser();
-		}
-	}
-
-	/**
-	 * @param l
-	 * @param selection
-	 * @param file
-	 */
-	protected void copyFile(final Long userId, final FolderDTO selection, final FileHeaderDTO fileToCopy) {
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		final TreeItem folder = GSS.get().getFolders().getCurrent();
-		final Long folderId = ((FolderDTO) folder.getUserObject()).getId();
-		service.copyFile(userId, fileToCopy.getId(), selection.getId(), fileToCopy.getName(), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
-				GSS.get().getStatusPanel().updateStats();
-				GSS.get().hideLoadingIndicator();
-			}
-
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-			}
-		});
-	}
-
-	/**
-	 * @param l
-	 * @param selection
-	 * @param file
-	 */
-	protected void copyFiles(final Long userId, final FolderDTO selection, final List fileToCopy) {
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		final TreeItem folder = GSS.get().getFolders().getCurrent();
-		final Long folderId = ((FolderDTO) folder.getUserObject()).getId();
-		final List fids = new ArrayList();
-		for (FileHeaderDTO f : fileToCopy)
-			fids.add(f.getId());
-		service.copyFiles(userId, fids, selection.getId(), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
-				GSS.get().getStatusPanel().updateStats();
-				GSS.get().hideLoadingIndicator();
-			}
-
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-			}
-		});
-	}
-
-	/**
-	 * @param l
-	 * @param selection
-	 * @param file
-	 */
-	protected void moveFiles(final Long userId, final FolderDTO selection, final List fileToCopy) {
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		final TreeItem folder = GSS.get().getFolders().getCurrent();
-		final Long folderId = ((FolderDTO) folder.getUserObject()).getId();
-		final List fids = new ArrayList();
-		for (FileHeaderDTO f : fileToCopy)
-			fids.add(f.getId());
-		service.moveFiles(userId, fids, selection.getId(), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
-				GSS.get().getStatusPanel().updateStats();
-				GSS.get().getClipboard().clear();
-				GSS.get().hideLoadingIndicator();
-			}
-
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
+		if (GSS.get().getCurrentSelection() instanceof FolderResource) {
+			final ClipboardItem citem = GSS.get().getClipboard().getItem();
+			if (citem != null && citem.getFolderResource() != null) {
+
+				String target = ((FolderResource) GSS.get().getCurrentSelection()).getPath();
+				target = target.endsWith("/") ? target : target + '/';
+				target = target + URL.encodeComponent(citem.getFolderResource().getName());
+				if (citem.getOperation() == Clipboard.COPY) {
+					ExecutePost cf = new ExecutePost(citem.getFolderResource().getPath() + "?copy=" + target, "", 200) {
+
+						public void onComplete() {
+							GSS.get().getFolders().updateFolder((DnDTreeItem) GSS.get().getFolders().getCurrent());
+						}
+
+
+						public void onError(Throwable t) {
+							GWT.log("", t);
+							if(t instanceof RestException){
+								int statusCode = ((RestException)t).getHttpStatusCode();
+								if(statusCode == 405)
+									GSS.get().displayError("You don't have the necessary permissions");
+
+								else if(statusCode == 409)
+									GSS.get().displayError("A folder with the same name already exists");
+								else if(statusCode == 413)
+									GSS.get().displayError("Your quota has been exceeded");
+								else
+									GSS.get().displayError("Unable to copy folder, status code:"+statusCode+", "+t.getMessage());
+							}
+							else
+								GSS.get().displayError("System error copying folder:"+t.getMessage());
+						}
+					};
+					DeferredCommand.addCommand(cf);
+				} else if (citem.getOperation() == Clipboard.CUT) {
+					ExecutePost cf = new ExecutePost(citem.getFolderResource().getPath() + "?move=" + target, "", 200) {
+
+						public void onComplete() {
+							List items = GSS.get().getFolders().getItemsOfTreeForPath(citem.getFolderResource().getPath());
+							for (TreeItem item : items)
+								if (item.getParentItem() != null && !item.equals(GSS.get().getFolders().getCurrent()))
+									GSS.get().getFolders().updateFolder((DnDTreeItem) item.getParentItem());
+							GSS.get().getFolders().updateFolder((DnDTreeItem) GSS.get().getFolders().getCurrent());
+						}
+
+						public void onError(Throwable t) {
+							GWT.log("", t);
+							if(t instanceof RestException){
+								int statusCode = ((RestException)t).getHttpStatusCode();
+								if(statusCode == 405)
+									GSS.get().displayError("You don't have the necessary permissions");
+								else if(statusCode == 409)
+									GSS.get().displayError("A folder with the same name already exists");
+								else if(statusCode == 413)
+									GSS.get().displayError("Your quota has been exceeded");
+								else
+									GSS.get().displayError("Unable to move folder, status code:"+statusCode+", "+t.getMessage());
+							}
+							else
+								GSS.get().displayError("System error moving folder:"+t.getMessage());
+						}
+					};
+					DeferredCommand.addCommand(cf);
+				}
+				return;
+			} else if (citem != null && citem.getFile() != null) {
+				String target = ((FolderResource) GSS.get().getCurrentSelection()).getPath();
+				target = target.endsWith("/") ? target : target + '/';
+				target = target + URL.encodeComponent(citem.getFile().getName());
+				if (citem.getOperation() == Clipboard.COPY) {
+					ExecutePost cf = new ExecutePost(citem.getFile().getPath() + "?copy=" + target, "", 200) {
+
+						public void onComplete() {
+							GSS.get().showFileList(true);
+						}
+
+						public void onError(Throwable t) {
+							GWT.log("", t);
+							if(t instanceof RestException){
+								int statusCode = ((RestException)t).getHttpStatusCode();
+								if(statusCode == 405)
+									GSS.get().displayError("You don't have the necessary permissions");
+								else if(statusCode == 404)
+									GSS.get().displayError("File not found");
+								else if(statusCode == 409)
+									GSS.get().displayError("A file with the same name already exists");
+								else if(statusCode == 413)
+									GSS.get().displayError("Your quota has been exceeded");
+								else
+									GSS.get().displayError("Unable to copy file");
+							}
+							else
+								GSS.get().displayError("System error copying file:"+t.getMessage());
+						}
+					};
+					DeferredCommand.addCommand(cf);
+				} else if (citem.getOperation() == Clipboard.CUT) {
+					ExecutePost cf = new ExecutePost(citem.getFile().getPath() + "?move=" + target, "", 200) {
+
+						public void onComplete() {
+							GSS.get().showFileList(true);
+						}
+
+						public void onError(Throwable t) {
+							GWT.log("", t);
+							if(t instanceof RestException){
+								int statusCode = ((RestException)t).getHttpStatusCode();
+								if(statusCode == 405)
+									GSS.get().displayError("You don't have the necessary permissions");
+								else if(statusCode == 404)
+									GSS.get().displayError("File not found");
+								else if(statusCode == 409)
+									GSS.get().displayError("A file with the same name already exists");
+								else if(statusCode == 413)
+									GSS.get().displayError("Your quota has been exceeded");
+								else
+									GSS.get().displayError("Unable to copy file");
+							}
+							else
+								GSS.get().displayError("System error copying file:"+t.getMessage());
+						}
+					};
+					DeferredCommand.addCommand(cf);
+				}
+				return;
+			} else if (citem != null && citem.getFiles() != null) {
+				List res = citem.getFiles();
+				List fileIds = new ArrayList();
+				String target = ((FolderResource) GSS.get().getCurrentSelection()).getPath();
+				target = target.endsWith("/") ? target : target + '/';
+
+				if (citem.getOperation() == Clipboard.COPY) {
+					for (FileResource fileResource : res) {
+						String fileTarget = target + fileResource.getName();
+						fileIds.add(fileResource.getPath() + "?copy=" + fileTarget);
+					}
+					int index = 0;
+					executeCopyOrMove(index, fileIds);
+
+				} else if (citem.getOperation() == Clipboard.CUT) {
+					for (FileResource fileResource : res) {
+						String fileTarget = target + fileResource.getName();
+						fileIds.add(fileResource.getPath() + "?move=" + fileTarget);
+					}
+					int index =0;
+					executeCopyOrMove(index, fileIds);
+
+				}
+				return;
 			}
-		});
-	}
-
-	protected void copyFolder(final Long userId, final FolderDTO selection, final FolderDTO folderToCopy) {
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		final TreeItem folder = GSS.get().getFolders().getCurrent();
-		final Long folderId = ((FolderDTO) folder.getUserObject()).getId();
-
-		service.copyFolderStructure(userId, folderToCopy.getId(), selection.getId(), folderToCopy.getName(), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				GSS.get().getFolders().onFolderCopy(folder);
-				GSS.get().hideLoadingIndicator();
-			}
-
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-			}
-		});
-	}
 
-	protected void moveFile(final Long userId, final FolderDTO selection, final FileHeaderDTO fileToCopy) {
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		final TreeItem folder = GSS.get().getFolders().getCurrent();
-		final Long folderId = ((FolderDTO) folder.getUserObject()).getId();
-		service.moveFile(userId, fileToCopy.getId(), selection.getId(), fileToCopy.getName(), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
-				GSS.get().getStatusPanel().updateStats();
-				GSS.get().getClipboard().clear();
-				GSS.get().hideLoadingIndicator();
-			}
-
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-			}
-		});
-	}
-
-	protected void moveFolder(final Long userId, final FolderDTO selection, final FolderDTO folderToCopy) {
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		final TreeItem folder = GSS.get().getFolders().getCurrent();
-		final Long folderId = ((FolderDTO) folder.getUserObject()).getId();
-		final FolderDTO selectionParent = folderToCopy.getParent();
-		service.moveFolder(userId, folderToCopy.getId(), selection.getId(), folderToCopy.getName(), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-
-				GSS.get().getFolders().onFolderMove(folder, selectionParent);
-				GSS.get().getClipboard().clear();
-				GSS.get().hideLoadingIndicator();
-			}
+		}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-			}
-		});
 	}
 
-	private void addUser() {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		GroupDTO group = (GroupDTO) GSS.get().getCurrentSelection();
-		UserDTO selectedUser = GSS.get().getClipboard().getItem().getUser();
-		if (group == null) {
-			GSS.get().displayError("Empty group name!");
-			return;
-		}
-		if (selectedUser == null) {
-			GSS.get().displayError("No User Selected!");
+	private void executeCopyOrMove(final int index, final List paths){
+		if(index >= paths.size()){
+			GSS.get().showFileList(true);
 			return;
 		}
-		service.addUserToGroup(GSS.get().getCurrentUser().getId(), group.getId(), selectedUser.getId(), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				GSS.get().getGroups().updateGroups(GSS.get().getCurrentUser().getId());
-				GSS.get().showUserList();
+		ExecutePost cf = new ExecutePost(paths.get(index), "", 200){
+			@Override
+			public void onComplete() {
+				executeCopyOrMove(index+1, paths);
 			}
 
-			public void onFailure(final Throwable caught) {
-
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+			@Override
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				if(t instanceof RestException){
+					int statusCode = ((RestException)t).getHttpStatusCode();
+					if(statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions");
+					else if(statusCode == 404)
+						GSS.get().displayError("File not found");
+					else if(statusCode == 409)
+						GSS.get().displayError("A file with the same name already exists");
+					else if(statusCode == 413)
+						GSS.get().displayError("Your quota has been exceeded");
+					else
+						GSS.get().displayError("Unable to copy file:"+t.getMessage());
+				}
 				else
-					GSS.get().displayError(caught.getMessage());
+					GSS.get().displayError("System error copying file:"+t.getMessage());
 
 			}
-		});
+		};
+		DeferredCommand.addCommand(cf);
 	}
-
 }
diff --git a/gss/src/gr/ebs/gss/client/commands/PropertiesCommand.java b/gss/src/gr/ebs/gss/client/commands/PropertiesCommand.java
index 3ac84b3..466914f 100644
--- a/gss/src/gr/ebs/gss/client/commands/PropertiesCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/PropertiesCommand.java
@@ -23,24 +23,22 @@ import gr.ebs.gss.client.FilePropertiesDialog;
 import gr.ebs.gss.client.FolderPropertiesDialog;
 import gr.ebs.gss.client.GSS;
 import gr.ebs.gss.client.FileMenu.Images;
-import gr.ebs.gss.client.domain.FileBodyDTO;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.PermissionDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteGet;
+import gr.ebs.gss.client.rest.ExecuteHead;
+import gr.ebs.gss.client.rest.ExecuteMultipleGet;
+import gr.ebs.gss.client.rest.ExecuteMultipleHead;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.GroupResource;
+import gr.ebs.gss.client.rest.resource.GroupsResource;
 
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.IncrementalCommand;
-import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.PopupPanel;
 
 /**
@@ -55,11 +53,9 @@ public class PropertiesCommand implements Command {
 
 	private PopupPanel containerPanel;
 
-	private Set permissions = null;
+	private List groups = null;
 
-	private List groups = null;
-
-	private List versions = null;
+	private List versions = null;
 
 	/**
 	 * @param _containerPanel
@@ -75,7 +71,46 @@ public class PropertiesCommand implements Command {
 	 */
 	public void execute() {
 		containerPanel.hide();
-		getPermissions();
+		if (GSS.get().getCurrentSelection() instanceof FolderResource) {
+			ExecuteGet eg = new ExecuteGet(FolderResource.class, ((FolderResource) GSS.get().getCurrentSelection()).getPath()) {
+
+				@Override
+				public void onComplete() {
+					GSS.get().setCurrentSelection(getResult());
+					initialize();
+				}
+
+				@Override
+				public void onError(Throwable t) {
+
+				}
+
+			};
+			DeferredCommand.addCommand(eg);
+		}
+		else if (GSS.get().getCurrentSelection() instanceof FileResource) {
+			ExecuteHead eg = new ExecuteHead(FileResource.class, ((FileResource) GSS.get().getCurrentSelection()).getPath()) {
+
+				@Override
+				public void onComplete() {
+					GSS.get().setCurrentSelection(getResult());
+					initialize();
+				}
+
+				@Override
+				public void onError(Throwable t) {
+
+				}
+
+			};
+			DeferredCommand.addCommand(eg);
+
+		}
+
+
+	}
+
+	private void initialize(){
 		getGroups();
 		getVersions();
 		DeferredCommand.addCommand(new IncrementalCommand() {
@@ -91,11 +126,10 @@ public class PropertiesCommand implements Command {
 			}
 
 		});
-
 	}
 
 	private boolean canContinue() {
-		if (permissions == null || groups == null || versions == null)
+		if (groups == null || versions == null)
 			return false;
 		return true;
 	}
@@ -107,112 +141,87 @@ public class PropertiesCommand implements Command {
 	 * @param propImages the images of all the possible properties dialogs
 	 */
 	void displayProperties(final Images propImages) {
-		Object selection = GSS.get().getCurrentSelection();
-		if (selection == null)
-			return;
-		GWT.log("selection: " + selection.toString(), null);
-		if (selection instanceof FolderDTO) {
-			FolderPropertiesDialog dlg = new FolderPropertiesDialog(propImages, false, permissions, groups);
+		// Object selection = GSS.get().getCurrentSelection();
+		// if (selection == null)
+		// return;
+		// GWT.log("selection: " + selection.toString(), null);
+		if (GSS.get().getCurrentSelection() instanceof FolderResource) {
+			FolderPropertiesDialog dlg = new FolderPropertiesDialog(propImages, false, groups);
 			dlg.center();
-		} else if (selection instanceof FileHeaderDTO) {
-			FilePropertiesDialog dlg = new FilePropertiesDialog(propImages, permissions, groups, versions);
+		} else if (GSS.get().getCurrentSelection() instanceof FileResource) {
+			FilePropertiesDialog dlg = new FilePropertiesDialog(propImages, groups, versions);
 			dlg.center();
-		} else if (selection instanceof UserDTO) {
-			// TODO implement user properties
-		} else if (selection instanceof GroupDTO) {
-			// TODO implement group properties
+
 		}
+
 	}
 
-	private void getPermissions() {
-		if (GSS.get().getCurrentSelection() instanceof FolderDTO)
-			GSS	.get()
-				.getRemoteService()
-				.getFolderPermissions(GSS.get().getCurrentUser().getId(), ((FolderDTO) GSS.get().getFolders().getCurrent().getUserObject()).getId(), new AsyncCallback() {
-
-					public void onFailure(Throwable caught) {
-						GWT.log("", caught);
-						if (caught instanceof RpcException)
-							GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-						else
-							GSS.get().displayError(caught.getMessage());
-						// initialize list object so that we avoid infinite loop
-						permissions = new HashSet();
-					}
+	private void getGroups() {
+		ExecuteGet gg = new ExecuteGet(GroupsResource.class, GSS.get().getCurrentUserResource().getGroupsPath()) {
 
-					public void onSuccess(Object result) {
-						permissions = (Set) result;
-					}
+			public void onComplete() {
+				GroupsResource res = getResult();
+				ExecuteMultipleGet ga = new ExecuteMultipleGet(GroupResource.class, res.getGroupPaths().toArray(new String[] {})) {
 
-				});
-		else if (GSS.get().getCurrentSelection() instanceof FileHeaderDTO)
-			GSS	.get()
-				.getRemoteService()
-				.getFilePermissions(GSS.get().getCurrentUser().getId(), ((FileHeaderDTO) GSS.get().getCurrentSelection()).getId(), new AsyncCallback() {
-
-					public void onFailure(Throwable caught) {
-						GWT.log("", caught);
-						if (caught instanceof RpcException)
-							GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-						else
-							GSS.get().displayError(caught.getMessage());
-						// initialize list object so that we avoid infinite loop
-						permissions = new HashSet();
+					public void onComplete() {
+						List groupList = getResult();
+						groups = groupList;
 					}
 
-					public void onSuccess(Object result) {
-						permissions = (Set) result;
+					public void onError(Throwable t) {
+						GWT.log("", t);
+						GSS.get().displayError("Unable to fetch groups");
+						groups = new ArrayList();
 					}
 
-				});
-
-	}
-
-	private void getGroups() {
-
-		GSS.get().getRemoteService().getGroups(GSS.get().getCurrentUser().getId(), new AsyncCallback() {
-
-			public void onFailure(Throwable caught) {
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-				// initialize list object so that we avoid infinite loop
-				groups = new ArrayList();
+					public void onError(String p, Throwable throwable) {
+						GWT.log("Path:" + p, throwable);
+					}
+				};
+				DeferredCommand.addCommand(ga);
 			}
 
-			public void onSuccess(Object result) {
-				groups = (List) result;
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				GSS.get().displayError("Unable to fetch groups");
+				groups = new ArrayList();
 			}
-
-		});
+		};
+		DeferredCommand.addCommand(gg);
 
 	}
 
 	private void getVersions() {
-		if (GSS.get().getCurrentSelection() instanceof FileHeaderDTO)
-			GSS	.get()
-				.getRemoteService()
-				.getVersions(GSS.get().getCurrentUser().getId(), ((FileHeaderDTO) GSS.get().getCurrentSelection()).getId(), new AsyncCallback() {
-
-					public void onFailure(Throwable caught) {
-						GWT.log("", caught);
-						if (caught instanceof RpcException)
-							GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-						else
-							GSS.get().displayError(caught.getMessage());
-						// initialize list object so that we avoid infinite loop
-						versions = new ArrayList();
+		if (GSS.get().getCurrentSelection() instanceof FileResource) {
+			FileResource afile = (FileResource) GSS.get().getCurrentSelection();
+			GWT.log("File is versioned:" + afile.isVersioned(), null);
+			if (afile.isVersioned()) {
+				List paths = new ArrayList();
+				for (int i = 0; i < afile.getVersion(); i++)
+					paths.add(afile.getPath() + "?version=" + i);
+				ExecuteMultipleHead gv = new ExecuteMultipleHead(FileResource.class, paths.toArray(new String[] {})) {
+
+					public void onComplete() {
+						versions = getResult();
+					}
+
+					@Override
+					public void onError(Throwable t) {
+						GWT.log("", t);
+						GSS.get().displayError("Unable to fetch versions");
+						versions = new ArrayList();
 					}
 
-					public void onSuccess(Object result) {
-						versions = (List) result;
+					public void onError(String p, Throwable throwable) {
+						GWT.log("Path:" + p, throwable);
 					}
+				};
+				DeferredCommand.addCommand(gv);
+			} else
+				versions = new ArrayList();
 
-				});
-		else
-			versions = new ArrayList();
+		} else
+			versions = new ArrayList();
 
 	}
 }
diff --git a/gss/src/gr/ebs/gss/client/commands/ResreshOthersSharesCommand.java b/gss/src/gr/ebs/gss/client/commands/ResreshOthersSharesCommand.java
index d67018a..404dbc7 100644
--- a/gss/src/gr/ebs/gss/client/commands/ResreshOthersSharesCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/ResreshOthersSharesCommand.java
@@ -40,7 +40,7 @@ public class ResreshOthersSharesCommand implements Command{
 	 */
 	public void execute() {
 		containerPanel.hide();
-		GSS.get().getFolders().update(GSS.get().getCurrentUser().getId(), GSS.get().getFolders().getCurrent());
+		GSS.get().getFolders().update( GSS.get().getFolders().getCurrent());
 	}
 
 }
diff --git a/gss/src/gr/ebs/gss/client/commands/RestoreTrashCommand.java b/gss/src/gr/ebs/gss/client/commands/RestoreTrashCommand.java
index 0edfad2..14083d6 100644
--- a/gss/src/gr/ebs/gss/client/commands/RestoreTrashCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/RestoreTrashCommand.java
@@ -19,18 +19,20 @@
 package gr.ebs.gss.client.commands;
 
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
 import gr.ebs.gss.client.domain.GroupDTO;
 import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteMultiplePost;
+import gr.ebs.gss.client.rest.ExecutePost;
+import gr.ebs.gss.client.rest.RestException;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
 
 import java.util.ArrayList;
 import java.util.List;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.ui.PopupPanel;
 import com.google.gwt.user.client.ui.TreeItem;
 
@@ -60,6 +62,7 @@ public class RestoreTrashCommand implements Command{
 			for(int i=0 ; i < trashItem.getChildCount() ; i++)
 				folderList.add(trashItem.getChild(i).getUserObject());
 			if(GSS.get().getFolders().getCurrent().equals(GSS.get().getFolders().getTrashItem()))
+				/*
 				GSS.get().getRemoteService().restoreTrash(GSS.get().getCurrentUser().getId(), new AsyncCallback() {
 
 					public void onSuccess(final Object result) {
@@ -81,71 +84,105 @@ public class RestoreTrashCommand implements Command{
 							GSS.get().displayError(caught.getMessage());
 					}
 				});
+				*/
 			return;
 		}
 		GWT.log("selection: " + selection.toString(), null);
-		if (selection instanceof FileHeaderDTO) {
-			FileHeaderDTO fdto = (FileHeaderDTO) selection;
-			fdto.setDeleted(false);
-			GSS.get().getRemoteService().removeFileFromTrash(GSS.get().getCurrentUser().getId(), fdto.getId(), new AsyncCallback() {
-
-				public void onSuccess(final Object result) {
-					GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
+		if (selection instanceof FileResource) {
+			final FileResource resource = (FileResource)selection;
+			ExecutePost rt = new ExecutePost(resource.getPath()+"?restore=","", 200){
 
+				public void onComplete() {
+					GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
+					GSS.get().showFileList(true);
 				}
 
-				public void onFailure(final Throwable caught) {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+				public void onError(Throwable t) {
+					GWT.log("", t);
+					if(t instanceof RestException){
+						int statusCode = ((RestException)t).getHttpStatusCode();
+						if(statusCode == 405)
+							GSS.get().displayError("You don't have the necessary permissions");
+						else if(statusCode == 404)
+							GSS.get().displayError("File does not exist");
+						else if(statusCode == 409)
+							GSS.get().displayError("A file with the same name already exists");
+						else if(statusCode == 413)
+							GSS.get().displayError("Your quota has been exceeded");
+						else
+							GSS.get().displayError("Unable to restore file, status code:"+statusCode);
+					}
 					else
-						GSS.get().displayError(caught.getMessage());
+						GSS.get().displayError("System error restoring file:"+t.getMessage());
 				}
-			});
+			};
+			DeferredCommand.addCommand(rt);
 		}
 		else if (selection instanceof List) {
-			List fdtos = (List) selection;
-			final List fileIds = new ArrayList();
-			for(FileHeaderDTO f : fdtos)
-				fileIds.add(f.getId());
-			GSS.get().getRemoteService().removeFilesFromTrash(GSS.get().getCurrentUser().getId(), fileIds, new AsyncCallback() {
-
-				public void onSuccess(final Object result) {
-					GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
-
+			final List fdtos = (List) selection;
+			final List fileIds = new ArrayList();
+			for(FileResource f : fdtos)
+				fileIds.add(f.getPath()+"?restore=");
+			ExecuteMultiplePost rt = new ExecuteMultiplePost(fileIds.toArray(new String[0]), 200){
+
+				public void onComplete() {
+					GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
+					GSS.get().showFileList(true);
 				}
 
-				public void onFailure(final Throwable caught) {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+
+				public void onError(String p, Throwable t) {
+					GWT.log("", t);
+					if(t instanceof RestException){
+						int statusCode = ((RestException)t).getHttpStatusCode();
+						if(statusCode == 405)
+							GSS.get().displayError("You don't have the necessary permissions");
+						else if(statusCode == 404)
+							GSS.get().displayError("File does not exist");
+						else if(statusCode == 409)
+							GSS.get().displayError("A file with the same name already exists");
+						else if(statusCode == 413)
+							GSS.get().displayError("Your quota has been exceeded");
+						else
+							GSS.get().displayError("Unable to restore file, status code:"+statusCode);
+					}
 					else
-						GSS.get().displayError(caught.getMessage());
-				}
-			});
+						GSS.get().displayError("System error restoring file:"+t.getMessage());
 
+				}
+			};
+			DeferredCommand.addCommand(rt);
 		}
-		else if (selection instanceof FolderDTO) {
-			final FolderDTO fdto = (FolderDTO) selection;
-			fdto.setDeleted(false);
-			GSS.get().getRemoteService().removeFolderFromTrash(GSS.get().getCurrentUser().getId(), fdto.getId(), new AsyncCallback() {
-
-				public void onSuccess(final Object result) {
-					GSS.get().getFolders().update(GSS.get().getCurrentUser().getId(), GSS.get().getFolders().getTrashItem());
-					GSS.get().getFolders().update(GSS.get().getCurrentUser().getId(), GSS.get().getFolders().getMySharesItem());
-					GSS.get().getFolders().update(GSS.get().getCurrentUser().getId(), GSS.get().getFolders().getUserItem(fdto.getParent()));
-					GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
-
+		else if (selection instanceof FolderResource) {
+			final FolderResource resource = (FolderResource)selection;
+			ExecutePost rt = new ExecutePost(resource.getPath()+"?restore=","", 200){
+
+				public void onComplete() {
+					GSS.get().getFolders().update(GSS.get().getFolders().getRootItem());
+					GSS.get().getFolders().update(GSS.get().getFolders().getMySharesItem());
+					GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
 				}
 
-				public void onFailure(final Throwable caught) {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+				public void onError(Throwable t) {
+					GWT.log("", t);
+					if(t instanceof RestException){
+						int statusCode = ((RestException)t).getHttpStatusCode();
+						if(statusCode == 405)
+							GSS.get().displayError("You don't have the necessary permissions");
+						else if(statusCode == 404)
+							GSS.get().displayError("Folder does not exist");
+						else if(statusCode == 409)
+							GSS.get().displayError("A folder with the same name already exists");
+						else if(statusCode == 413)
+							GSS.get().displayError("Your quota has been exceeded");
+						else
+							GSS.get().displayError("Unable to restore folder, status code:"+statusCode);
+					}
 					else
-						GSS.get().displayError(caught.getMessage());
+						GSS.get().displayError("System error restoring folder:"+t.getMessage());
 				}
-			});
+			};
+			DeferredCommand.addCommand(rt);
 		} else if (selection instanceof UserDTO) {
 			// TODO do we need trash in users?
 		} else if (selection instanceof GroupDTO) {
diff --git a/gss/src/gr/ebs/gss/client/commands/ToTrashCommand.java b/gss/src/gr/ebs/gss/client/commands/ToTrashCommand.java
index b91a714..b916024 100644
--- a/gss/src/gr/ebs/gss/client/commands/ToTrashCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/ToTrashCommand.java
@@ -21,18 +21,19 @@ package gr.ebs.gss.client.commands;
 
 
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.dnd.DnDTreeItem;
+import gr.ebs.gss.client.rest.ExecuteMultiplePost;
+import gr.ebs.gss.client.rest.ExecutePost;
+import gr.ebs.gss.client.rest.RestException;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
 
 import java.util.ArrayList;
 import java.util.List;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.ui.PopupPanel;
 import com.google.gwt.user.client.ui.TreeItem;
 
@@ -59,71 +60,89 @@ public class ToTrashCommand implements Command{
 		if (selection == null)
 			return;
 		GWT.log("selection: " + selection.toString(), null);
-		if (selection instanceof FolderDTO) {
-			FolderDTO fdto = (FolderDTO) selection;
-			fdto.setDeleted(true);
-			GSS.get().getRemoteService().moveFolderToTrash(GSS.get().getCurrentUser().getId(), fdto.getId(), new AsyncCallback() {
+		if (selection instanceof FolderResource) {
+			FolderResource fdto = (FolderResource) selection;
+			ExecutePost tot = new ExecutePost(fdto.getPath()+"?trash=","",200){
 
-				public void onSuccess(final Object result) {
+				public void onComplete() {
 					TreeItem folder = GSS.get().getFolders().getCurrent();
-					GSS.get().getFolders().onFolderTrash(folder);
+					GSS.get().getFolders().updateFolder((DnDTreeItem) folder.getParentItem());
+					GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
 				}
 
-				public void onFailure(final Throwable caught) {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+				public void onError(Throwable t) {
+					GWT.log("", t);
+					if(t instanceof RestException){
+						int statusCode = ((RestException)t).getHttpStatusCode();
+						if(statusCode == 405)
+							GSS.get().displayError("You don't have the necessary permissions");
+						else if(statusCode == 404)
+							GSS.get().displayError("Folder does not exist");
+						else
+							GSS.get().displayError("Unable to trash folder, status code:"+statusCode);
+					}
 					else
-						GSS.get().displayError(caught.getMessage());
+						GSS.get().displayError("System error trashing folder:"+t.getMessage());
 				}
-			});
-		} else if (selection instanceof FileHeaderDTO) {
-			FileHeaderDTO fdto = (FileHeaderDTO) selection;
-			fdto.setDeleted(true);
-			GSS.get().getRemoteService().moveFileToTrash(GSS.get().getCurrentUser().getId(), fdto.getId(), new AsyncCallback() {
-
-				public void onSuccess(final Object result) {
-					GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
-
+			};
+			DeferredCommand.addCommand(tot);
+		} else if (selection instanceof FileResource) {
+			FileResource fdto = (FileResource) selection;
+			ExecutePost tot = new ExecutePost(fdto.getPath()+"?trash=","",200){
+
+				public void onComplete() {
+					GSS.get().showFileList(true);
 				}
 
-				public void onFailure(final Throwable caught) {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+				public void onError(Throwable t) {
+					GWT.log("", t);
+					if(t instanceof RestException){
+						int statusCode = ((RestException)t).getHttpStatusCode();
+						if(statusCode == 405)
+							GSS.get().displayError("You don't have the necessary permissions");
+						else if(statusCode == 404)
+							GSS.get().displayError("File does not exist");
+						else
+							GSS.get().displayError("Unable to trash file, status code:"+statusCode);
+					}
 					else
-						GSS.get().displayError(caught.getMessage());
+						GSS.get().displayError("System error trashing file:"+t.getMessage());
 				}
-			});
+			};
+			DeferredCommand.addCommand(tot);
 
 		}
 		else if (selection instanceof List) {
-			List fdtos = (List) selection;
-			final List fileIds = new ArrayList();
-			for(FileHeaderDTO f : fdtos)
-				fileIds.add(f.getId());
-			GSS.get().getRemoteService().moveFilesToTrash(GSS.get().getCurrentUser().getId(), fileIds, new AsyncCallback() {
-
-				public void onSuccess(final Object result) {
-					GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
-
+			List fdtos = (List) selection;
+			final List fileIds = new ArrayList();
+			for(FileResource f : fdtos)
+				fileIds.add(f.getPath()+"?trash=");
+			ExecuteMultiplePost tot = new ExecuteMultiplePost(fileIds.toArray(new String[0]),200){
+
+				public void onComplete() {
+					GSS.get().showFileList(true);
 				}
 
-				public void onFailure(final Throwable caught) {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+
+				public void onError(String p, Throwable t) {
+					GWT.log("", t);
+					if(t instanceof RestException){
+						int statusCode = ((RestException)t).getHttpStatusCode();
+						if(statusCode == 405)
+							GSS.get().displayError("You don't have the necessary permissions");
+						else if(statusCode == 404)
+							GSS.get().displayError("File does not exist");
+						else
+							GSS.get().displayError("Unable to trash file, status code:"+statusCode);
+					}
 					else
-						GSS.get().displayError(caught.getMessage());
+						GSS.get().displayError("System error trashing file:"+t.getMessage());
 				}
-			});
+			};
+			DeferredCommand.addCommand(tot);
 
 		}
-		else if (selection instanceof UserDTO) {
-			// TODO do we need trash in users?
-		} else if (selection instanceof GroupDTO) {
-			// TODO do we need trash for groups?
-		}
+
 	}
 
 }
diff --git a/gss/src/gr/ebs/gss/client/commands/UpdateFileCommand.java b/gss/src/gr/ebs/gss/client/commands/UpdateFileCommand.java
index b6ec813..9472847 100644
--- a/gss/src/gr/ebs/gss/client/commands/UpdateFileCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/UpdateFileCommand.java
@@ -20,7 +20,7 @@ package gr.ebs.gss.client.commands;
 
 import gr.ebs.gss.client.FileUpdateDialog;
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
+import gr.ebs.gss.client.rest.resource.FileResource;
 
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.DeferredCommand;
@@ -47,7 +47,7 @@ public class UpdateFileCommand implements Command{
 		Object selected = GSS.get().getCurrentSelection();
 		if(selected == null)
 			return;
-		if(selected instanceof FileHeaderDTO)
+		if(selected instanceof FileResource)
 			displayNewFile();
 	}
 
diff --git a/gss/src/gr/ebs/gss/client/commands/UploadFileCommand.java b/gss/src/gr/ebs/gss/client/commands/UploadFileCommand.java
index 99bd069..d3983fe 100644
--- a/gss/src/gr/ebs/gss/client/commands/UploadFileCommand.java
+++ b/gss/src/gr/ebs/gss/client/commands/UploadFileCommand.java
@@ -20,18 +20,16 @@ package gr.ebs.gss.client.commands;
 
 import gr.ebs.gss.client.FileUploadDialog;
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteGet;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
 
 import java.util.ArrayList;
 import java.util.List;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.IncrementalCommand;
-import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.PopupPanel;
 import com.google.gwt.user.client.ui.TreeItem;
 
@@ -44,7 +42,7 @@ public class UploadFileCommand implements Command {
 
 	private PopupPanel containerPanel;
 
-	List files;
+	List files;
 	boolean monitorCall = false;
 	public UploadFileCommand(PopupPanel _containerPanel) {
 		containerPanel = _containerPanel;
@@ -92,27 +90,18 @@ public class UploadFileCommand implements Command {
 	}
 
 	private void getFileList() {
+		ExecuteGet eg = new ExecuteGet(FolderResource.class,((FolderResource)GSS.get().getFolders().getCurrent().getUserObject()).getPath()){
 
-		GSS	.get()
-			.getRemoteService()
-			.getFiles(GSS.get().getCurrentUser().getId(), ((FolderDTO) GSS.get().getFolders().getCurrent().getUserObject()).getId(), new AsyncCallback() {
-
-				public void onFailure(Throwable caught) {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-					else
-						GSS.get().displayError(caught.getMessage());
-					// initialize list object so that we avoid infinite loop
-					files = new ArrayList();
-
-				}
+			public void onComplete() {
+				files = getResult().getFiles();
+			}
 
-				public void onSuccess(Object result) {
-					files = (List) result;
-				}
+			public void onError(Throwable t) {
+				files = new ArrayList();
+			}
 
-			});
+		};
+		DeferredCommand.addCommand(eg);
 
 	}
 
diff --git a/gss/src/gr/ebs/gss/client/dnd/DnDDropController.java b/gss/src/gr/ebs/gss/client/dnd/DnDDropController.java
index 06dcdf9..0365e89 100644
--- a/gss/src/gr/ebs/gss/client/dnd/DnDDropController.java
+++ b/gss/src/gr/ebs/gss/client/dnd/DnDDropController.java
@@ -19,8 +19,8 @@
 package gr.ebs.gss.client.dnd;
 
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
 
 import java.util.List;
 
@@ -49,31 +49,27 @@ public class DnDDropController extends SimpleDropController {
 		super.onDrop(context);
 		DnDFocusPanel toDrop = (DnDFocusPanel) context.draggable;
 		if (toDrop.getItem() != null) {
-			FolderDTO folderToDrop = (FolderDTO) toDrop.getItem().getUserObject();
-			FolderDTO initialFolder = null;
-			if (GSS.get().getFolders().isTrash(nodeHolder.getItem())) {
-			} else if (nodeHolder.getItem().getUserObject() instanceof FolderDTO)
-				initialFolder = (FolderDTO) nodeHolder.getItem().getUserObject();
-
-			// copyFolder(GSS.get().getCurrentUser().getId(), initialFolder,
-			// folderToDrop);
-			boolean othersShared = false;
-			if (GSS.get().getFolders().isOthersSharedItem(nodeHolder.getItem()))
-				othersShared = true;
-			DnDFolderPopupMenu popup = new DnDFolderPopupMenu(GSS.get().getFolders().getImages(), initialFolder, folderToDrop, othersShared);
-			int left = nodeHolder.getItem().getAbsoluteLeft() + 40;
-			int top = nodeHolder.getItem().getAbsoluteTop() + 20;
-			popup.setPopupPosition(left, top);
-			popup.show();
+			if (toDrop.getItem().getUserObject() != null && toDrop.getItem().getUserObject() instanceof FolderResource) {
+				FolderResource folderToDrop = (FolderResource) toDrop.getItem().getUserObject();
+				FolderResource initialFolder = null;
+				if (GSS.get().getFolders().isTrash(nodeHolder.getItem())) {
+				} else if (nodeHolder.getItem().getUserObject() instanceof FolderResource)
+					initialFolder = (FolderResource) nodeHolder.getItem().getUserObject();
+				boolean othersShared = false;
+				if (GSS.get().getFolders().isOthersSharedItem(nodeHolder.getItem()))
+					othersShared = true;
+				DnDFolderPopupMenu popup = new DnDFolderPopupMenu(GSS.get().getFolders().getImages(), initialFolder, folderToDrop, othersShared);
+				int left = nodeHolder.getItem().getAbsoluteLeft() + 40;
+				int top = nodeHolder.getItem().getAbsoluteTop() + 20;
+				popup.setPopupPosition(left, top);
+				popup.show();
+			}
 		} else if (toDrop.getFiles() != null) {
-			List folderToDrop = toDrop.getFiles();
-			FolderDTO initialFolder = null;
+			List folderToDrop = toDrop.getFiles();
+			FolderResource initialFolder = null;
 			if (GSS.get().getFolders().isTrash(nodeHolder.getItem())) {
-			} else if (nodeHolder.getItem().getUserObject() instanceof FolderDTO)
-				initialFolder = (FolderDTO) nodeHolder.getItem().getUserObject();
-
-			// copyFolder(GSS.get().getCurrentUser().getId(), initialFolder,
-			// folderToDrop);
+			} else if (nodeHolder.getItem().getUserObject() instanceof FolderResource)
+				initialFolder = (FolderResource) nodeHolder.getItem().getUserObject();
 			boolean othersShared = false;
 			if (GSS.get().getFolders().isOthersSharedItem(nodeHolder.getItem()))
 				othersShared = true;
diff --git a/gss/src/gr/ebs/gss/client/dnd/DnDFocusPanel.java b/gss/src/gr/ebs/gss/client/dnd/DnDFocusPanel.java
index 66f2987..6c75ba4 100644
--- a/gss/src/gr/ebs/gss/client/dnd/DnDFocusPanel.java
+++ b/gss/src/gr/ebs/gss/client/dnd/DnDFocusPanel.java
@@ -18,7 +18,7 @@
  */
 package gr.ebs.gss.client.dnd;
 
-import gr.ebs.gss.client.domain.FileHeaderDTO;
+import gr.ebs.gss.client.rest.resource.FileResource;
 
 import java.util.List;
 
@@ -33,7 +33,7 @@ import com.google.gwt.user.client.ui.Widget;
  */
 public class DnDFocusPanel extends FocusPanel{
 	private DnDTreeItem item;
-	private List files;
+	private List files;
 
 	public DnDFocusPanel(Widget widget,DnDTreeItem item){
 		super(widget);
@@ -65,7 +65,7 @@ public class DnDFocusPanel extends FocusPanel{
 	 *
 	 * @return the files
 	 */
-	public List getFiles() {
+	public List getFiles() {
 		return files;
 	}
 
@@ -75,7 +75,7 @@ public class DnDFocusPanel extends FocusPanel{
 	 *
 	 * @param files the files to set
 	 */
-	public void setFiles(List files) {
+	public void setFiles(List files) {
 		this.files = files;
 	}
 
diff --git a/gss/src/gr/ebs/gss/client/dnd/DnDFolderPopupMenu.java b/gss/src/gr/ebs/gss/client/dnd/DnDFolderPopupMenu.java
index 706a20f..60fa10a 100644
--- a/gss/src/gr/ebs/gss/client/dnd/DnDFolderPopupMenu.java
+++ b/gss/src/gr/ebs/gss/client/dnd/DnDFolderPopupMenu.java
@@ -20,17 +20,19 @@ package gr.ebs.gss.client.dnd;
 
 import gr.ebs.gss.client.Folders;
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.GSSServiceAsync;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteMultiplePost;
+import gr.ebs.gss.client.rest.ExecutePost;
+import gr.ebs.gss.client.rest.RestException;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.RestResource;
 
 import java.util.ArrayList;
 import java.util.List;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.ui.MenuBar;
 import com.google.gwt.user.client.ui.PopupPanel;
 import com.google.gwt.user.client.ui.TreeItem;
@@ -45,7 +47,7 @@ public class DnDFolderPopupMenu extends PopupPanel {
 	 */
 	private final Folders.Images images;
 
-	public DnDFolderPopupMenu(final Folders.Images newImages, final FolderDTO target, final Object toCopy, boolean othersShared) {
+	public DnDFolderPopupMenu(final Folders.Images newImages, final FolderResource target, final Object toCopy, boolean othersShared) {
 		// The popup's constructor's argument is a boolean specifying that it
 		// auto-close itself when the user clicks outside of it.
 		super(true);
@@ -62,14 +64,21 @@ public class DnDFolderPopupMenu extends PopupPanel {
 
 		final MenuBar contextMenu = new MenuBar(true);
 		final Folders folders = GSS.get().getFolders();
+
 		if (!othersShared)
 			contextMenu.addItem("" + newImages.cut().getHTML() + " Move", true, new Command() {
 
 				public void execute() {
-					if (toCopy instanceof FolderDTO)
-						cutFolder(GSS.get().getCurrentUser().getId(), target, (FolderDTO) toCopy);
-					else if (toCopy instanceof List)
-						moveFiles(GSS.get().getCurrentUser().getId(), target, (List) toCopy);
+					if (toCopy instanceof FolderResource){
+						List treeItems = folders.getItemsOfTreeForPath(((RestResource) toCopy).getPath());
+						List parents = new ArrayList();
+						for(TreeItem item : treeItems)
+							if(item.getParentItem() != null)
+								parents.add(item.getParentItem());
+						moveFolder(target, (FolderResource) toCopy, parents);
+					}
+					else if(toCopy instanceof List)
+						moveFiles(target, (List) toCopy);
 					hide();
 				}
 
@@ -78,11 +87,10 @@ public class DnDFolderPopupMenu extends PopupPanel {
 		contextMenu.addItem("" + newImages.copy().getHTML() + " Copy", true, new Command() {
 
 			public void execute() {
-				if (toCopy instanceof FolderDTO)
-					copyFolder(GSS.get().getCurrentUser().getId(), target, (FolderDTO) toCopy);
-				else if (toCopy instanceof List)
-					copyFiles(GSS.get().getCurrentUser().getId(), target, (List) toCopy);
-
+				if (toCopy instanceof FolderResource)
+					copyFolder(target, (FolderResource) toCopy);
+				else if(toCopy instanceof List)
+					copyFiles(target, (List) toCopy);
 				hide();
 			}
 
@@ -91,10 +99,16 @@ public class DnDFolderPopupMenu extends PopupPanel {
 		contextMenu.addItem("" + newImages.trash().getHTML() + " Delete (Trash)", true, new Command() {
 
 			public void execute() {
-				if (toCopy instanceof FolderDTO && target == null)
-					moveFolderToTrash(GSS.get().getCurrentUser().getId(), (FolderDTO) toCopy);
-				else if (toCopy instanceof List)
-					moveFilesToTrash(GSS.get().getCurrentUser().getId(), (List) toCopy);
+				if (toCopy instanceof FolderResource){
+					final List treeItems = folders.getItemsOfTreeForPath(((RestResource) toCopy).getPath());
+					List parents = new ArrayList();
+					for(TreeItem item : treeItems)
+						if(item.getParentItem() != null)
+							parents.add(item.getParentItem());
+					trashFolder((FolderResource) toCopy, parents);
+				}
+				else if(toCopy instanceof List)
+					trashFiles((List) toCopy);
 				hide();
 			}
 
@@ -105,154 +119,200 @@ public class DnDFolderPopupMenu extends PopupPanel {
 
 	}
 
-	protected void copyFiles(final Long userId, final FolderDTO selection, final List fileToCopy) {
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		final List fids = new ArrayList();
-		for (FileHeaderDTO f : fileToCopy)
-			fids.add(f.getId());
-		service.copyFiles(userId, fids, selection.getId(), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
-				GSS.get().getStatusPanel().updateStats();
-				GSS.get().hideLoadingIndicator();
+	private void copyFolder(final FolderResource target, FolderResource toCopy) {
+		String atarget = target.getPath();
+		atarget = atarget.endsWith("/") ? atarget : atarget + '/';
+		atarget = atarget + toCopy.getName();
+		ExecutePost cf = new ExecutePost(toCopy.getPath() + "?copy=" + atarget, "", 200) {
+
+			public void onComplete() {
+				final TreeItem folder;
+				TreeItem folderTemp = GSS.get().getFolders().getUserItem(target);
+				if (folderTemp == null)
+					folder = GSS.get().getFolders().getOtherSharedItem(target);
+				else
+					folder = folderTemp;
+				GSS.get().getFolders().updateFolder((DnDTreeItem) folder);
 			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				if (t instanceof RestException) {
+					int statusCode = ((RestException) t).getHttpStatusCode();
+					if (statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions");
+
+					else if (statusCode == 409)
+						GSS.get().displayError("A folder with the same name already exists");
+					else if (statusCode == 413)
+						GSS.get().displayError("Your quota has been exceeded");
+					else
+						GSS.get().displayError("Unable to copy folder, status code:" + statusCode + ", " + t.getMessage());
+				} else
+					GSS.get().displayError("System error copying folder:" + t.getMessage());
 			}
-		});
+		};
+		DeferredCommand.addCommand(cf);
 	}
 
-	protected void moveFiles(final Long userId, final FolderDTO selection, final List fileToCopy) {
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		final List fids = new ArrayList();
-		for (FileHeaderDTO f : fileToCopy)
-			fids.add(f.getId());
-		service.moveFiles(userId, fids, selection.getId(), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
-				GSS.get().getStatusPanel().updateStats();
-				GSS.get().getClipboard().clear();
-				GSS.get().hideLoadingIndicator();
-			}
+	private void moveFolder(final FolderResource target, FolderResource toCopy, final List items) {
+		String atarget = target.getPath();
+		atarget = atarget.endsWith("/") ? atarget : atarget + '/';
+		atarget = atarget + toCopy.getName();
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+		ExecutePost cf = new ExecutePost(toCopy.getPath() + "?move=" + atarget, "", 200) {
+
+			public void onComplete() {
+				final TreeItem folder;
+				TreeItem folderTemp = GSS.get().getFolders().getUserItem(target);
+				if (folderTemp == null)
+					folder = GSS.get().getFolders().getOtherSharedItem(target);
 				else
-					GSS.get().displayError(caught.getMessage());
+					folder = folderTemp;
+				GSS.get().getFolders().updateFolder((DnDTreeItem) folder);
+				for(TreeItem item : items)
+					GSS.get().getFolders().updateFolder((DnDTreeItem) item);
+				GSS.get().getFolders().clearSelection();
+				GSS.get().showFileList(true);
+			}
+
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				if (t instanceof RestException) {
+					int statusCode = ((RestException) t).getHttpStatusCode();
+					if (statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions");
+
+					else if (statusCode == 409)
+						GSS.get().displayError("A folder with the same name already exists");
+					else if (statusCode == 413)
+						GSS.get().displayError("Your quota has been exceeded");
+					else
+						GSS.get().displayError("Unable to copy folder, status code:" + statusCode + ", " + t.getMessage());
+				} else
+					GSS.get().displayError("System error copying folder:" + t.getMessage());
 			}
-		});
+		};
+		DeferredCommand.addCommand(cf);
 	}
 
-	protected void moveFilesToTrash(final Long userId, final List files) {
-		final List fileIds = new ArrayList();
-		for (FileHeaderDTO f : files)
-			fileIds.add(f.getId());
-		GSS.get().getRemoteService().moveFilesToTrash(GSS.get().getCurrentUser().getId(), fileIds, new AsyncCallback() {
+	private void copyFiles(final FolderResource ftarget, List files) {
+		List fileIds = new ArrayList();
+		String target = ftarget.getPath();
+		target = target.endsWith("/") ? target : target + '/';
+		for (FileResource fileResource : files) {
+			String fileTarget = target + fileResource.getName();
+			fileIds.add(fileResource.getPath() + "?copy=" + fileTarget);
+		}
+		int index = 0;
+		executeCopyOrMoveFiles(index, fileIds);
 
-			public void onSuccess(final Object result) {
-				GSS.get().getFileList().updateFileCache(GSS.get().getCurrentUser().getId());
+	}
 
-			}
+	private void moveFiles(final FolderResource ftarget, List files) {
+		List fileIds = new ArrayList();
+		String target = ftarget.getPath();
+		target = target.endsWith("/") ? target : target + '/';
+		for (FileResource fileResource : files) {
+			String fileTarget = target + fileResource.getName();
+			fileIds.add(fileResource.getPath() + "?move=" + fileTarget);
+		}
+		int index = 0;
+		executeCopyOrMoveFiles(index, fileIds);
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-			}
-		});
 	}
 
-	protected void cutFolder(final Long userId, final FolderDTO selection, final FolderDTO folderToCopy) {
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		final TreeItem folder;
-		TreeItem folderTemp = GSS.get().getFolders().getUserItem(selection);
-		if (folderTemp == null)
-			folder = GSS.get().getFolders().getOtherSharedItem(selection);
-		else
-			folder = folderTemp;
-		final FolderDTO selectionParent = folderToCopy.getParent();
-		service.moveFolder(userId, folderToCopy.getId(), selection.getId(), folderToCopy.getName(), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				GSS.get().getFolders().onFolderMove(folder, selectionParent);
-				GSS.get().getClipboard().clear();
-				GSS.get().hideLoadingIndicator();
+	private void trashFolder(final FolderResource folder, final List items){
+		ExecutePost tot = new ExecutePost(folder.getPath()+"?trash=","",200){
+
+			public void onComplete() {
+				for(TreeItem item : items)
+					GSS.get().getFolders().updateFolder((DnDTreeItem) item);
+				GSS.get().getFolders().update(GSS.get().getFolders().getTrashItem());
+				GSS.get().showFileList(true);
 			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				if(t instanceof RestException){
+					int statusCode = ((RestException)t).getHttpStatusCode();
+					if(statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions");
+					else if(statusCode == 404)
+						GSS.get().displayError("Folder does not exist");
+					else
+						GSS.get().displayError("Unable to trash folder, status code:"+statusCode);
+				}
 				else
-					GSS.get().displayError(caught.getMessage());
+					GSS.get().displayError("System error trashing folder:"+t.getMessage());
 			}
-		});
+		};
+		DeferredCommand.addCommand(tot);
 	}
 
-	protected void copyFolder(final Long userId, final FolderDTO selection, final FolderDTO folderToCopy) {
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		final TreeItem folder;
-		TreeItem folderTemp = GSS.get().getFolders().getUserItem(selection);
-		if (folderTemp == null)
-			folder = GSS.get().getFolders().getOtherSharedItem(selection);
-		else
-			folder = folderTemp;
-
-		service.copyFolderStructure(userId, folderToCopy.getId(), selection.getId(), folderToCopy.getName(), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				GSS.get().getFolders().onFolderCopy(folder);
-				GSS.get().hideLoadingIndicator();
+	private void trashFiles(List files){
+		final List fileIds = new ArrayList();
+		for(FileResource f : files)
+			fileIds.add(f.getPath()+"?trash=");
+		ExecuteMultiplePost tot = new ExecuteMultiplePost(fileIds.toArray(new String[0]),200){
+
+			public void onComplete() {
+				GSS.get().showFileList(true);
 			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
+
+			public void onError(String p, Throwable t) {
+				GWT.log("", t);
+				if(t instanceof RestException){
+					int statusCode = ((RestException)t).getHttpStatusCode();
+					if(statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions");
+					else if(statusCode == 404)
+						GSS.get().displayError("File does not exist");
+					else
+						GSS.get().displayError("Unable to trash file, status code:"+statusCode);
+				}
 				else
-					GSS.get().displayError(caught.getMessage());
+					GSS.get().displayError("System error trashing file:"+t.getMessage());
 			}
-		});
+		};
+		DeferredCommand.addCommand(tot);
 	}
 
-	protected void moveFolderToTrash(Long userId, final FolderDTO selection) {
-		FolderDTO fdto = selection;
-		fdto.setDeleted(true);
-		GSS.get().getRemoteService().moveFolderToTrash(GSS.get().getCurrentUser().getId(), fdto.getId(), new AsyncCallback() {
 
-			public void onSuccess(final Object result) {
-				TreeItem folder = GSS.get().getFolders().getCurrent();
-				GSS.get().getFolders().onFolderTrash(folder);
+	private void executeCopyOrMoveFiles(final int index, final List paths) {
+		if (index >= paths.size()) {
+			GSS.get().showFileList(true);
+			return;
+		}
+		ExecutePost cf = new ExecutePost(paths.get(index), "", 200) {
 
+			@Override
+			public void onComplete() {
+				executeCopyOrMoveFiles(index + 1, paths);
 			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
+			@Override
+			public void onError(Throwable t) {
+				GWT.log("", t);
+				if (t instanceof RestException) {
+					int statusCode = ((RestException) t).getHttpStatusCode();
+					if (statusCode == 405)
+						GSS.get().displayError("You don't have the necessary permissions");
+					else if (statusCode == 404)
+						GSS.get().displayError("File not found");
+					else if (statusCode == 409)
+						GSS.get().displayError("A file with the same name already exists");
+					else if (statusCode == 413)
+						GSS.get().displayError("Your quota has been exceeded");
+					else
+						GSS.get().displayError("Unable to copy file:" + t.getMessage());
+				} else
+					GSS.get().displayError("System error copying file:" + t.getMessage());
+
 			}
-		});
+		};
+		DeferredCommand.addCommand(cf);
 	}
 
 }
diff --git a/gss/src/gr/ebs/gss/client/dnd/DnDTreeItem.java b/gss/src/gr/ebs/gss/client/dnd/DnDTreeItem.java
index 8afd508..05d203c 100644
--- a/gss/src/gr/ebs/gss/client/dnd/DnDTreeItem.java
+++ b/gss/src/gr/ebs/gss/client/dnd/DnDTreeItem.java
@@ -20,8 +20,12 @@ package gr.ebs.gss.client.dnd;
 
 import gr.ebs.gss.client.Folders;
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.domain.FolderDTO;
 import gr.ebs.gss.client.domain.UserDTO;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.OtherUserResource;
+import gr.ebs.gss.client.rest.resource.OthersResource;
+import gr.ebs.gss.client.rest.resource.SharedResource;
+import gr.ebs.gss.client.rest.resource.TrashResource;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -51,6 +55,7 @@ public class DnDTreeItem extends TreeItem implements SourcesMouseEvents {
 	private List toRemove = new ArrayList();
 	private boolean draggable = false;
 
+
 	public DnDTreeItem(Widget widget,String name, boolean _draggable) {
 		super();
 		draggable = _draggable;
@@ -60,6 +65,10 @@ public class DnDTreeItem extends TreeItem implements SourcesMouseEvents {
 		setWidget(focus);
 	}
 
+	public void setFocus(){
+		((DnDFocusPanel)getWidget()).setFocus(true);
+	}
+
 	public void updateWidget(Widget widget){
 		content = widget;
 		focus.setWidget(content);
@@ -165,11 +174,11 @@ public class DnDTreeItem extends TreeItem implements SourcesMouseEvents {
 		return draggable;
 	}
 
-	public DnDTreeItem getChild(FolderDTO folder){
+	public DnDTreeItem getChild(FolderResource folder){
 		for(int i=0; i< getChildCount(); i++){
 			DnDTreeItem c = (DnDTreeItem) getChild(i);
-			if(c.getUserObject() instanceof FolderDTO)
-				if(((FolderDTO)c.getUserObject()).getId().equals(folder.getId()))
+			if(c.getUserObject() instanceof FolderResource)
+				if(((FolderResource)c.getUserObject()).getPath().equals(folder.getPath()))
 					return c;
 		}
 		return null;
@@ -204,4 +213,104 @@ public class DnDTreeItem extends TreeItem implements SourcesMouseEvents {
 	}
 
 
+	/**
+	 * Retrieve the folderResource.
+	 *
+	 * @return the folderResource
+	 */
+	public FolderResource getFolderResource() {
+		if(getUserObject() instanceof FolderResource)
+			return (FolderResource)getUserObject();
+		return null;
+	}
+
+
+
+
+
+	/**
+	 * Retrieve the sharedResource.
+	 *
+	 * @return the sharedResource
+	 */
+	public SharedResource getSharedResource() {
+		if(getUserObject() instanceof SharedResource)
+			return (SharedResource)getUserObject();
+		return null;
+	}
+
+
+
+
+
+	/**
+	 * Retrieve the trashResource.
+	 *
+	 * @return the trashResource
+	 */
+	public TrashResource getTrashResource() {
+		if(getUserObject() instanceof TrashResource)
+			return (TrashResource)getUserObject();
+		return null;
+	}
+
+
+
+
+
+	/**
+	 * Retrieve the othersResource.
+	 *
+	 * @return the othersResource
+	 */
+	public OthersResource getOthersResource() {
+		if(getUserObject() instanceof OthersResource)
+			return (OthersResource)getUserObject();
+		return null;
+	}
+
+
+	/**
+	 * Retrieve the otherUserResource.
+	 *
+	 * @return the otherUserResource
+	 */
+	public OtherUserResource getOtherUserResource() {
+		if(getUserObject() instanceof OtherUserResource)
+			return (OtherUserResource)getUserObject();
+		return null;
+	}
+
+
+
+
+	public boolean needExpanding(){
+		/*if(GSS.get().getFolders().isMySharedItem(this) && ! GSS.get().getFolders().isMyShares(this)){
+			if(getFolderResource() != null){
+				SharedResource sr = ((DnDTreeItem)GSS.get().getFolders().getMySharesItem()).getSharedResource();
+				int count =0;
+				for(String s : getFolderResource().getSubfolderPaths())
+					if(sr.getSubfolders().contains(s))
+						count++;
+				if(count != getChildCount())
+					return true;
+			}
+		}
+		else*/
+		if(getFolderResource() != null){
+			//if(equals(GSS.get().getFolders().getRootItem()))
+				//return false;
+			if(getFolderResource().getFolders().size() > 0)
+				for(FolderResource r : getFolderResource().getFolders() )
+					if(r.isNeedsExpanding())
+						return true;
+			if(getFolderResource().getSubfolderPaths().size() != getChildCount())
+				return true;
+		}
+		else if (getOtherUserResource() != null)
+			if(getOtherUserResource().getSubfolderPaths().size() != getChildCount())
+				return true;
+		return false;
+	}
+
 }
diff --git a/gss/src/gr/ebs/gss/client/rest/AbstractRestCommand.java b/gss/src/gr/ebs/gss/client/rest/AbstractRestCommand.java
new file mode 100644
index 0000000..85e11aa
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/AbstractRestCommand.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+
+import gr.ebs.gss.client.GSS;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.user.client.IncrementalCommand;
+
+/**
+ * @author kman
+ */
+public abstract class AbstractRestCommand implements IncrementalCommand{
+
+
+	protected void handleHeaders(String username, RequestBuilder requestBuilder, String path){
+		String date = getDate();
+		requestBuilder.setHeader("X-GSS-Date", date);
+
+		String token = GSS.get().getToken();
+		if (token == null)
+			token = "aa";
+		String resource = path.substring(GSS.GSS_REST_PATH.length()-1,path.length());
+		String sig = calculateSig(requestBuilder.getHTTPMethod(), date, resource, base64decode(token));
+		requestBuilder.setHeader("Authorization", username + " " + sig);
+		requestBuilder.setHeader("Accept", "application/json; charset=utf-8");
+		requestBuilder.setHeader("Accept-Charset", "utf-8");
+	}
+
+	protected void handleHeaders(RequestBuilder requestBuilder, String path) {
+		if (GSS.get().getCurrentUserResource() != null){
+			String username = GSS.get().getCurrentUserResource().getUsername();
+			handleHeaders(username, requestBuilder, path);
+		}
+		else{
+			GSS.get().displayError("no username");
+			return;
+		}
+
+	}
+
+	public static native String getDate()/*-{
+		return (new Date()).toUTCString();
+	}-*/;
+	//return $wnd.sayHello(method,date,resource,token);
+	public static native String calculateSig(String method, String date, String resource, String token)/*-{
+
+		 $wnd.b64pad = "=";
+			var resource2 = decodeURI(resource);
+			var q = resource2.indexOf('?');
+			var res = q == -1? resource2: resource2.substring(0, q);
+			var data = method + date + encodeURIComponent(decodeURIComponent(res));
+			var sig = $wnd.b64_hmac_sha1(token, data);
+			return sig;
+}-*/;
+
+	public static native String base64decode(String encStr)/*-{
+		if (typeof atob === 'function') {
+           return atob(encStr);
+        }
+        var base64s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+        var bits;
+        var decOut = "";
+        var i = 0;
+        for(; i>16, (bits & 0xff00) >>8, bits & 0xff);
+        }
+        if(encStr.charCodeAt(i -2) == 61){
+            return(decOut.substring(0, decOut.length -2));
+        }
+        else if(encStr.charCodeAt(i -1) == 61){
+            return(decOut.substring(0, decOut.length -1));
+        }
+        else {
+            return(decOut);
+        }
+	}-*/;
+
+	protected class RestRequestBuilder extends RequestBuilder {
+		String methodOverride = null;
+		/**
+		 * @param httpMethod
+		 * @param url
+		 */
+		public RestRequestBuilder(String httpMethod, String url) {
+			super(httpMethod, url);
+		}
+
+		/**
+		 * @param httpMethod
+		 * @param url
+		 */
+		public RestRequestBuilder(String httpMethod, String httpOverridenMethod, String url) {
+			super(httpMethod, url);
+			methodOverride = httpOverridenMethod;
+			if(methodOverride != null)
+				setHeader("X-HTTP-Method-Override", methodOverride);
+		}
+
+	}
+
+	public void onComplete(){}
+
+	public abstract void onError(Throwable t);
+
+	public String fixPath(String pathToFix){
+		if(pathToFix.endsWith("/"))
+			return pathToFix;
+		return pathToFix+"/";
+	}
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/CallbackList.java b/gss/src/gr/ebs/gss/client/rest/CallbackList.java
new file mode 100644
index 0000000..52dd7bc
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/CallbackList.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+
+
+/**
+ * @author kman
+ *
+ */
+public class CallbackList implements AsyncCallback{
+	List result = new ArrayList();
+	boolean erroneous = false;
+
+	public void onFailure(Throwable arg0) {
+		GWT.log("Error in callback list", arg0);
+		erroneous = true;
+
+	}
+
+
+	public void onSuccess(T arg0) {
+		result.add(arg0);
+	}
+
+
+
+	/**
+	 * Retrieve the result.
+	 *
+	 * @return the result
+	 */
+	public List getResult() {
+		return result;
+	}
+
+
+
+	/**
+	 * Retrieve the erroneous.
+	 *
+	 * @return the erroneous
+	 */
+	public boolean isErroneous() {
+		return erroneous;
+	}
+
+
+
+
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/ExecuteDelete.java b/gss/src/gr/ebs/gss/client/rest/ExecuteDelete.java
new file mode 100644
index 0000000..3feabfe
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/ExecuteDelete.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+
+import gr.ebs.gss.client.GSS;
+import gr.ebs.gss.client.exceptions.InsufficientPermissionsException;
+
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.RequestCallback;
+import com.google.gwt.http.client.Response;
+
+
+/**
+ * @author kman
+ *
+ */
+public abstract class ExecuteDelete extends AbstractRestCommand{
+
+	boolean complete = false;
+
+	public ExecuteDelete(String pathToDelete){
+		GSS.get().showLoadingIndicator();
+		final String path;
+		if(pathToDelete.endsWith("/"))
+			path = pathToDelete;
+		else
+			path = pathToDelete+"/";
+		RestRequestBuilder builder = new RestRequestBuilder("DELETE", path);
+
+		try {
+			handleHeaders(builder, path);
+			builder.sendRequest("", new RequestCallback() {
+
+
+				public void onError(Request arg0, Throwable arg1) {
+					complete = true;
+					ExecuteDelete.this.onError(arg1);
+				}
+
+
+				public void onResponseReceived(Request arg0, Response arg1) {
+					complete=true;
+					if(arg1.getStatusCode() == 204)
+						onComplete();
+					else if(arg1.getStatusCode() == 405)
+						ExecuteDelete.this.onError(new InsufficientPermissionsException("You don't have permissions to delete this resource"));
+					else
+						ExecuteDelete.this.onError(new RestException(path, arg1.getStatusCode(), arg1.getStatusText(), arg1.getText()));
+				}
+
+			});
+		} catch (Exception ex) {
+			complete=true;
+			onError(ex);
+		}
+	}
+
+	public boolean isComplete() {
+		return complete;
+	}
+
+	public boolean execute() {
+		boolean com = isComplete();
+		if(com){
+			GSS.get().hideLoadingIndicator();
+			return false;
+		}
+		return true;
+	}
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/ExecuteGet.java b/gss/src/gr/ebs/gss/client/rest/ExecuteGet.java
new file mode 100644
index 0000000..b6e1d01
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/ExecuteGet.java
@@ -0,0 +1,209 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+import gr.ebs.gss.client.GSS;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.GroupResource;
+import gr.ebs.gss.client.rest.resource.GroupUserResource;
+import gr.ebs.gss.client.rest.resource.GroupsResource;
+import gr.ebs.gss.client.rest.resource.OtherUserResource;
+import gr.ebs.gss.client.rest.resource.OthersResource;
+import gr.ebs.gss.client.rest.resource.RestResource;
+import gr.ebs.gss.client.rest.resource.SearchResource;
+import gr.ebs.gss.client.rest.resource.SharedResource;
+import gr.ebs.gss.client.rest.resource.TagsResource;
+import gr.ebs.gss.client.rest.resource.TrashResource;
+import gr.ebs.gss.client.rest.resource.UploadStatusResource;
+import gr.ebs.gss.client.rest.resource.UserResource;
+
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.Response;
+
+
+
+/**
+ * @author kman
+ *
+ */
+public abstract class ExecuteGet extends AbstractRestCommand{
+
+	boolean complete = false;
+	T result = null;
+	Class aclass;
+
+	public ExecuteGet(Class aclass, String pathToGet){
+		GSS.get().showLoadingIndicator();
+		this.aclass = aclass;
+		final String path;
+		if(pathToGet.indexOf("?") != -1)
+			path = pathToGet;
+		else
+			path =fixPath(pathToGet);
+		RestRequestBuilder builder = new RestRequestBuilder("GET", null, path);
+
+		try {
+			handleHeaders(builder, path);
+			builder.sendRequest("", new RestCallback(path) {
+
+				public Object deserialize(Response response) {
+					return deserializeResponse(path, response);
+				}
+
+				public void handleError(Request request, Throwable exception) {
+					complete = true;
+					ExecuteGet.this.onError(exception);
+				}
+
+				public void handleSuccess(Object object) {
+					result = (T) object;
+					complete = true;
+				}
+
+			});
+		} catch (Exception ex) {
+			complete = true;
+			onError(ex);
+		}
+	}
+
+	public ExecuteGet(Class aclass, String username , String pathToGet){
+		GSS.get().showLoadingIndicator();
+		this.aclass = aclass;
+		final String path = fixPath(pathToGet);
+		RestRequestBuilder builder = new RestRequestBuilder("GET", path);
+
+		try {
+			handleHeaders(username, builder, path);
+			builder.sendRequest("", new RestCallback(path) {
+
+				public Object deserialize(Response response) {
+					return deserializeResponse(path, response);
+				}
+
+				public void handleError(Request request, Throwable exception) {
+					complete = true;
+					ExecuteGet.this.onError(exception);
+				}
+
+				public void handleSuccess(Object object) {
+					result = (T) object;
+					complete = true;
+				}
+
+			});
+		} catch (Exception ex) {
+			complete = true;
+			onError(ex);
+		}
+	}
+
+	public boolean isComplete() {
+		return complete;
+	}
+
+	public T getResult(){
+		return result;
+	}
+
+	public boolean execute() {
+		boolean com = isComplete();
+		if(com){
+			GSS.get().hideLoadingIndicator();
+			if(getResult() != null)
+				onComplete();
+			return false;
+		}
+		return true;
+	}
+
+	public  Object deserializeResponse(String path, Response response){
+		RestResource result1 = null;
+		if(aclass.equals(FolderResource.class)){
+			result1 = new FolderResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(FileResource.class)){
+			result1 = new FileResource(path);
+			result1.createFromJSON(response.getHeader("X-GSS-Metadata"));
+			((FileResource)result1).setContentType(response.getHeader("Content-Type"));
+			((FileResource)result1).setContentLength(new Long(response.getHeader("Content-Length")));
+		}
+		else if(aclass.equals(GroupsResource.class)){
+			result1 = new GroupsResource(path);
+			result1.createFromJSON(response.getText());
+		}
+		else if(aclass.equals(TrashResource.class)){
+			result1 = new TrashResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(SharedResource.class)){
+			result1 = new SharedResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(OthersResource.class)){
+			result1 = new OthersResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(OtherUserResource.class)){
+			result1 = new OtherUserResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(GroupResource.class)){
+			result1 = new GroupResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(GroupUserResource.class)){
+			result1 = new GroupUserResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(UserResource.class)){
+			result1 = new UserResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(TagsResource.class)){
+			result1 = new TagsResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(SearchResource.class)){
+			result1 = new SearchResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(UploadStatusResource.class)){
+			result1 = new UploadStatusResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		return result1;
+
+	}
+
+
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/ExecuteHead.java b/gss/src/gr/ebs/gss/client/rest/ExecuteHead.java
new file mode 100644
index 0000000..b7074a7
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/ExecuteHead.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+
+import gr.ebs.gss.client.GSS;
+import gr.ebs.gss.client.exceptions.ObjectNotFoundException;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.GroupResource;
+import gr.ebs.gss.client.rest.resource.GroupUserResource;
+import gr.ebs.gss.client.rest.resource.GroupsResource;
+import gr.ebs.gss.client.rest.resource.RestResource;
+import gr.ebs.gss.client.rest.resource.SharedResource;
+import gr.ebs.gss.client.rest.resource.TrashResource;
+import gr.ebs.gss.client.rest.resource.UserResource;
+
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.Response;
+
+
+/**
+ * @author kman
+ *
+ */
+public  abstract class ExecuteHead  extends AbstractRestCommand{
+
+	boolean complete = false;
+	T result = null;
+	Class aclass;
+
+	public ExecuteHead(Class aclass, String pathToGet){
+		this.aclass = aclass;
+		GSS.get().showLoadingIndicator();
+		final String path;
+		if(aclass.equals(FileResource.class))
+			path = pathToGet;
+		else
+			path = fixPath(pathToGet);
+		RestRequestBuilder builder = new RestRequestBuilder("HEAD", path);
+
+		try {
+			handleHeaders(builder, path);
+			builder.sendRequest("", new RestCallback(path) {
+
+				public Object deserialize(Response response) {
+					return deserializeResponse(path, response);
+				}
+
+				public void handleError(Request request, Throwable exception) {
+					complete = true;
+					ExecuteHead.this.onError(exception);
+				}
+
+				public void handleSuccess(Object object) {
+					result = (T) object;
+					complete = true;
+				}
+
+			});
+		} catch (Exception ex) {
+			complete = true;
+			onError(ex);
+		}
+	}
+
+
+	public boolean isComplete() {
+		return complete;
+	}
+
+	public T getResult(){
+		return result;
+	}
+
+	public boolean execute() {
+		boolean com = isComplete();
+		if(com){
+			GSS.get().hideLoadingIndicator();
+			if(getResult() != null)
+				onComplete();
+			else
+				onError(new ObjectNotFoundException("Resource Not Found"));
+			return false;
+		}
+		return true;
+	}
+
+	public  Object deserializeResponse(String path, Response response){
+		RestResource result1 = null;
+		if(aclass.equals(FolderResource.class)){
+			result1 = new FolderResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(FileResource.class)){
+			result1 = new FileResource(path);
+			result1.createFromJSON(response.getHeader("X-GSS-Metadata"));
+			((FileResource)result1).setContentType(response.getHeader("Content-Type"));
+			((FileResource)result1).setContentLength(new Long(response.getHeader("Content-Length")));
+		}
+		else if(aclass.equals(GroupsResource.class)){
+			result1 = new GroupsResource(path);
+			result1.createFromJSON(response.getText());
+		}
+		else if(aclass.equals(TrashResource.class)){
+			result1 = new TrashResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(SharedResource.class)){
+			result1 = new SharedResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(GroupResource.class)){
+			result1 = new GroupResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(GroupUserResource.class)){
+			result1 = new GroupUserResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(UserResource.class)){
+			result1 = new UserResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		return result1;
+
+	}
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/ExecuteMultipleDelete.java b/gss/src/gr/ebs/gss/client/rest/ExecuteMultipleDelete.java
new file mode 100644
index 0000000..a4ea245
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/ExecuteMultipleDelete.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+
+import gr.ebs.gss.client.GSS;
+import gr.ebs.gss.client.exceptions.InsufficientPermissionsException;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.RequestCallback;
+import com.google.gwt.http.client.Response;
+
+/**
+ * @author kman
+ */
+public abstract class ExecuteMultipleDelete extends AbstractRestCommand {
+
+
+	Map errors = new HashMap();
+
+	List successPaths = new ArrayList();
+
+	String[] paths;
+
+	public ExecuteMultipleDelete(String[] pathToDelete) {
+		GSS.get().showLoadingIndicator();
+		paths = pathToDelete;
+		for (final String pathg : pathToDelete) {
+			GWT.log("[DEL]"+pathg, null);
+			RestRequestBuilder builder = new RestRequestBuilder("DELETE", pathg);
+
+			try {
+				handleHeaders(builder, pathg);
+				builder.sendRequest("", new RequestCallback() {
+
+					public void onError(Request arg0, Throwable arg1) {
+						errors.put(pathg, arg1);
+					}
+
+					public void onResponseReceived(Request arg0, Response arg1) {
+						if (arg1.getStatusCode() == 204)
+							successPaths.add(pathg);
+						else if (arg1.getStatusCode() == 405)
+							errors.put(pathg, new InsufficientPermissionsException("You don't have permissions to delete this resource"));
+						else
+							errors.put(pathg, new RestException(pathg, arg1.getStatusCode(), arg1.getStatusText(), arg1.getText()));
+					}
+
+				});
+			} catch (Exception ex) {
+				errors.put(pathg, ex);
+			}
+		}
+	}
+
+	public boolean isComplete() {
+		return errors.size() + successPaths.size() == paths.length;
+	}
+
+	public boolean execute() {
+		boolean com = isComplete();
+		if (com) {
+			if(hasErrors())
+				for(String p : errors.keySet())
+					onError(p, errors.get(p));
+			onComplete();
+			GSS.get().hideLoadingIndicator();
+			return false;
+		}
+		return true;
+	}
+
+	public boolean hasErrors(){
+		return errors.size() >0;
+	}
+
+
+	/**
+	 * Retrieve the errors.
+	 *
+	 * @return the errors
+	 */
+	public Map getErrors() {
+		return errors;
+	}
+
+	public void debug(){
+		GWT.log("-ERRORS-->"+getErrors().size(), null);
+		for(String p : getErrors().keySet())
+			GWT.log("error:"+p, getErrors().get(p));
+	}
+
+	public abstract void onError(String path, Throwable throwable);
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/ExecuteMultipleGet.java b/gss/src/gr/ebs/gss/client/rest/ExecuteMultipleGet.java
new file mode 100644
index 0000000..496abca
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/ExecuteMultipleGet.java
@@ -0,0 +1,217 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+
+import gr.ebs.gss.client.GSS;
+import gr.ebs.gss.client.exceptions.ObjectNotFoundException;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.GroupResource;
+import gr.ebs.gss.client.rest.resource.GroupUserResource;
+import gr.ebs.gss.client.rest.resource.GroupsResource;
+import gr.ebs.gss.client.rest.resource.OtherUserResource;
+import gr.ebs.gss.client.rest.resource.OthersResource;
+import gr.ebs.gss.client.rest.resource.RestResource;
+import gr.ebs.gss.client.rest.resource.SharedResource;
+import gr.ebs.gss.client.rest.resource.TrashResource;
+import gr.ebs.gss.client.rest.resource.UserResource;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.Response;
+
+/**
+ * @author kman
+ */
+public abstract class ExecuteMultipleGet extends AbstractRestCommand {
+
+	Class aclass;
+	List result = new ArrayList();
+	Map errors = new HashMap();
+	String[] paths;
+	public ExecuteMultipleGet(Class aclass, String[] pathToGet) {
+		GSS.get().showLoadingIndicator();
+		this.aclass = aclass;
+		this.paths = pathToGet;
+		for (String pathg : pathToGet) {
+			final String path = fixPath(pathg);
+			RestRequestBuilder builder = new RestRequestBuilder("GET",  path);
+
+			try {
+				handleHeaders(builder, path);
+				builder.sendRequest("", new RestCallback(path) {
+
+					public Object deserialize(Response response) {
+						return deserializeResponse(path, response);
+					}
+
+					public void handleError(Request request, Throwable exception) {
+
+						errors.put(path, exception);
+						//ExecuteMultipleGet.this.onError(exception);
+					}
+
+					public void handleSuccess(Object object) {
+						if(object!= null)
+							result.add((T)object);
+						else
+							errors.put(path, new ObjectNotFoundException("resource not found"));
+
+
+					}
+
+				});
+			} catch (Exception ex) {
+				errors.put(path, ex);
+			}
+		}
+	}
+
+	public boolean isComplete() {
+		return result.size()+errors.size() == paths.length;
+	}
+
+	public List getResult() {
+		if(aclass.equals(FolderResource.class))
+			Collections.sort(result, new Comparator(){
+				public int compare(Object o1, Object o2) {
+					return ((FolderResource)o1).getName().compareTo(((FolderResource)o2).getName());
+				}
+
+			});
+		else if(aclass.equals(GroupResource.class))
+			Collections.sort(result, new Comparator(){
+				public int compare(Object o1, Object o2) {
+					return ((GroupResource)o1).getName().compareTo(((GroupResource)o2).getName());
+				}
+
+			});
+		else if(aclass.equals(GroupUserResource.class))
+			Collections.sort(result, new Comparator(){
+				public int compare(Object o1, Object o2) {
+					return ((GroupUserResource)o1).getName().compareTo(((GroupUserResource)o2).getName());
+				}
+
+			});
+		return result;
+	}
+
+	public boolean execute() {
+		boolean com = isComplete();
+		if (com) {
+			GSS.get().hideLoadingIndicator();
+			if(hasErrors())
+				for(String p : errors.keySet())
+					onError(p, errors.get(p));
+			onComplete();
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * @param p
+	 * @param throwable
+	 */
+	public abstract void onError(String p, Throwable throwable);
+
+	public Object deserializeResponse(String path, Response response) {
+		RestResource result1 = null;
+		if(aclass.equals(FolderResource.class)){
+			result1 = new FolderResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(FileResource.class)){
+			result1 = new FileResource(path);
+			result1.createFromJSON(response.getHeader("X-GSS-Metadata"));
+			((FileResource)result1).setContentType(response.getHeader("Content-Type"));
+			((FileResource)result1).setContentLength(new Long(response.getHeader("Content-Length")));
+		}
+		else if(aclass.equals(GroupsResource.class)){
+			result1 = new GroupsResource(path);
+			result1.createFromJSON(response.getText());
+		}
+		else if(aclass.equals(TrashResource.class)){
+			result1 = new TrashResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(SharedResource.class)){
+			result1 = new SharedResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(OthersResource.class)){
+			result1 = new OthersResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(OtherUserResource.class)){
+			result1 = new OtherUserResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(GroupResource.class)){
+			result1 = new GroupResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(GroupUserResource.class)){
+			result1 = new GroupUserResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		else if(aclass.equals(UserResource.class)){
+			result1 = new UserResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		return result1;
+
+	}
+
+	public boolean hasErrors(){
+		return errors.size() >0;
+	}
+
+
+	/**
+	 * Retrieve the errors.
+	 *
+	 * @return the errors
+	 */
+	public Map getErrors() {
+		return errors;
+	}
+
+	public void debug(){
+		GWT.log("--->"+result.size(), null);
+		GWT.log("-ERRORS-->"+getErrors().size(), null);
+		for(String p : getErrors().keySet())
+			GWT.log("error:"+p, getErrors().get(p));
+	}
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/ExecuteMultipleHead.java b/gss/src/gr/ebs/gss/client/rest/ExecuteMultipleHead.java
new file mode 100644
index 0000000..e3d398d
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/ExecuteMultipleHead.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+
+import gr.ebs.gss.client.GSS;
+import gr.ebs.gss.client.exceptions.ObjectNotFoundException;
+import gr.ebs.gss.client.rest.resource.FileResource;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.GroupResource;
+import gr.ebs.gss.client.rest.resource.GroupUserResource;
+import gr.ebs.gss.client.rest.resource.GroupsResource;
+import gr.ebs.gss.client.rest.resource.RestResource;
+import gr.ebs.gss.client.rest.resource.SharedResource;
+import gr.ebs.gss.client.rest.resource.TrashResource;
+import gr.ebs.gss.client.rest.resource.UserResource;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.Response;
+
+
+/**
+ * @author kman
+ *
+ */
+public abstract class ExecuteMultipleHead  extends AbstractRestCommand {
+	String[] paths;
+	Class aclass;
+	List result = new ArrayList();
+	Map errors = new HashMap();
+
+	public ExecuteMultipleHead(Class aclass, String[] pathToGet) {
+		GSS.get().showLoadingIndicator();
+		paths = pathToGet;
+		this.aclass = aclass;
+		for (String pathg : pathToGet) {
+			final String path;
+			if(aclass.equals(FileResource.class))
+				path = pathg;
+			else
+				path = fixPath(pathg);
+			RestRequestBuilder builder = new RestRequestBuilder("HEAD", path);
+
+			try {
+				handleHeaders(builder, path);
+				builder.sendRequest("", new RestCallback(path) {
+
+					public Object deserialize(Response response) {
+						return deserializeResponse(path, response);
+					}
+
+					public void handleError(Request request, Throwable exception) {
+						errors.put(path, exception);
+					}
+
+					public void handleSuccess(Object object) {
+						if(object!= null)
+							result.add((T)object);
+						else
+							errors.put(path, new ObjectNotFoundException("resource not found"));
+
+
+					}
+
+				});
+			} catch (Exception ex) {
+				errors.put(path, ex);
+			}
+		}
+	}
+
+	public boolean isComplete() {
+		return result.size()+errors.size() == paths.length;
+	}
+
+	public List getResult() {
+		return result;
+	}
+
+	public boolean execute() {
+		boolean com = isComplete();
+		if (com) {
+			GSS.get().hideLoadingIndicator();
+			if(hasErrors())
+				for(String p : errors.keySet())
+					onError(p, errors.get(p));
+			onComplete();
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * @param p
+	 * @param throwable
+	 */
+	public abstract void onError(String p, Throwable throwable);
+
+	public Object deserializeResponse(String path, Response response) {
+		RestResource result1 = null;
+		if (aclass.equals(FolderResource.class)) {
+			result1 = new FolderResource(path);
+			result1.createFromJSON(response.getText());
+
+		} else if (aclass.equals(FileResource.class)) {
+			result1 = new FileResource(path);
+			result1.createFromJSON(response.getHeader("X-GSS-Metadata"));
+			((FileResource) result1).setContentType(response.getHeader("Content-Type"));
+			((FileResource) result1).setContentLength(new Long(response.getHeader("Content-Length")));
+		} else if (aclass.equals(GroupsResource.class)) {
+			result1 = new GroupsResource(path);
+			result1.createFromJSON(response.getText());
+		} else if (aclass.equals(TrashResource.class)) {
+			result1 = new TrashResource(path);
+			result1.createFromJSON(response.getText());
+
+		} else if (aclass.equals(SharedResource.class)) {
+			result1 = new SharedResource(path);
+			result1.createFromJSON(response.getText());
+
+		} else if (aclass.equals(GroupResource.class)) {
+			result1 = new GroupResource(path);
+			result1.createFromJSON(response.getText());
+
+		} else if (aclass.equals(GroupUserResource.class)) {
+			result1 = new GroupUserResource(path);
+			result1.createFromJSON(response.getText());
+
+		} else if (aclass.equals(UserResource.class)) {
+			result1 = new UserResource(path);
+			result1.createFromJSON(response.getText());
+
+		}
+		return result1;
+
+	}
+
+	public boolean hasErrors(){
+		return errors.size() >0;
+	}
+
+
+	/**
+	 * Retrieve the errors.
+	 *
+	 * @return the errors
+	 */
+	public Map getErrors() {
+		return errors;
+	}
+
+	public void debug(){
+		GWT.log("--->"+result.size(), null);
+		GWT.log("-ERRORS-->"+getErrors().size(), null);
+		for(String p : getErrors().keySet())
+			GWT.log("error:"+p, getErrors().get(p));
+	}
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/ExecuteMultiplePost.java b/gss/src/gr/ebs/gss/client/rest/ExecuteMultiplePost.java
new file mode 100644
index 0000000..e2e3e77
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/ExecuteMultiplePost.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+
+import gr.ebs.gss.client.GSS;
+import gr.ebs.gss.client.exceptions.InsufficientPermissionsException;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.RequestCallback;
+import com.google.gwt.http.client.Response;
+
+
+/**
+ * @author kman
+ *
+ */
+public abstract class ExecuteMultiplePost extends AbstractRestCommand {
+
+
+	Map errors = new HashMap();
+
+	List successPaths = new ArrayList();
+
+	String[] paths;
+
+	public ExecuteMultiplePost(String[] pathToDelete, final int okStatusCode) {
+		GSS.get().showLoadingIndicator();
+		paths = pathToDelete;
+		for (final String pathg : pathToDelete) {
+			GWT.log("[DEL]"+pathg, null);
+			RestRequestBuilder builder = new RestRequestBuilder("POST", pathg);
+
+			try {
+				handleHeaders(builder, pathg);
+				builder.sendRequest("", new RequestCallback() {
+
+					public void onError(Request arg0, Throwable arg1) {
+						errors.put(pathg, arg1);
+					}
+
+					public void onResponseReceived(Request arg0, Response arg1) {
+						if (arg1.getStatusCode() == okStatusCode)
+							successPaths.add(pathg);
+						else if (arg1.getStatusCode() == 405)
+							errors.put(pathg, new InsufficientPermissionsException("You don't have permissions to delete this resource"));
+						else
+							errors.put(pathg, new RestException(pathg, arg1.getStatusCode(), arg1.getStatusText(), arg1.getText()));
+					}
+
+				});
+			} catch (Exception ex) {
+				errors.put(pathg, ex);
+			}
+		}
+	}
+
+	public boolean isComplete() {
+		return errors.size() + successPaths.size() == paths.length;
+	}
+
+	public boolean execute() {
+		boolean com = isComplete();
+		if (com) {
+			if(hasErrors())
+				for(String p : errors.keySet())
+					onError(p, errors.get(p));
+			onComplete();
+			GSS.get().hideLoadingIndicator();
+			return false;
+		}
+		return true;
+	}
+
+
+	/**
+	 * @param p
+	 * @param throwable
+	 */
+	public abstract void onError(String p, Throwable throwable);
+
+	public boolean hasErrors(){
+		return errors.size() >0;
+	}
+
+
+	/**
+	 * Retrieve the errors.
+	 *
+	 * @return the errors
+	 */
+	public Map getErrors() {
+		return errors;
+	}
+
+	public void debug(){
+		GWT.log("-ERRORS-->"+getErrors().size(), null);
+		for(String p : getErrors().keySet())
+			GWT.log("error:"+p, getErrors().get(p));
+	}
+
+	@Override
+	public void onError(Throwable t) {
+
+
+	}
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/ExecutePost.java b/gss/src/gr/ebs/gss/client/rest/ExecutePost.java
new file mode 100644
index 0000000..9f9f3b5
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/ExecutePost.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+
+import gr.ebs.gss.client.GSS;
+
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.RequestCallback;
+import com.google.gwt.http.client.Response;
+
+
+/**
+ * @author kman
+ *
+ */
+public abstract class ExecutePost extends AbstractRestCommand{
+	boolean complete = false;
+	String postBody=null;
+
+	public ExecutePost(final String path, String data, final int okStatusCode){
+		GSS.get().showLoadingIndicator();
+
+		RestRequestBuilder builder = new RestRequestBuilder("POST", path);
+
+		try {
+			handleHeaders(builder, path);
+			builder.sendRequest(data, new RequestCallback() {
+
+
+				public void onError(Request arg0, Throwable arg1) {
+					complete = true;
+					ExecutePost.this.onError(arg1);
+				}
+
+
+				public void onResponseReceived(Request arg0, Response arg1) {
+					complete=true;
+					if(arg1.getStatusCode() == okStatusCode){
+						postBody = arg1.getText();
+						onComplete();
+					}
+					else
+						ExecutePost.this.onError(new RestException(path, arg1.getStatusCode(), arg1.getStatusText(), arg1.getText()));
+				}
+
+			});
+		} catch (Exception ex) {
+			complete=true;
+			onError(ex);
+		}
+	}
+
+	public boolean isComplete() {
+		return complete;
+	}
+
+	public boolean execute() {
+		boolean com = isComplete();
+		if(com){
+			GSS.get().hideLoadingIndicator();
+			return false;
+		}
+		return true;
+	}
+
+
+	/**
+	 * Retrieve the postBody.
+	 *
+	 * @return the postBody
+	 */
+	public String getPostBody() {
+		return postBody;
+	}
+
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/RestCallback.java b/gss/src/gr/ebs/gss/client/rest/RestCallback.java
new file mode 100644
index 0000000..61f1d3c
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/RestCallback.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.RequestCallback;
+import com.google.gwt.http.client.Response;
+
+
+/**
+ * @author kman
+ *
+ */
+public abstract class RestCallback  implements RequestCallback {
+
+	private static final int HTTP_OK = 200;
+	private String path;
+	private int okcode = -1;
+
+	public RestCallback(String path) {
+		this.path = path;
+	}
+
+	public RestCallback(String path, int okCode) {
+		this.path = path;
+		okcode = okCode;
+	}
+
+	public void onError(Request request, Throwable exception) {
+		handleError(request, exception);
+	}
+
+	public void onResponseReceived(Request request, Response response) {
+		try {
+			if (okcode == -1 && response.getStatusCode() == HTTP_OK)
+				handleSuccess(deserialize(response));
+			//this one is only used for trash handling where empty trash has 201 status code
+			else if(okcode !=-1 && (response.getStatusCode() == okcode || response.getStatusCode() == HTTP_OK))
+				handleSuccess(deserialize(response));
+			else
+				handleError(request, new RestException(path, response.getStatusCode(), response.getStatusText(), response.getText()));
+		} catch (Exception e) {
+			handleError(request,e);
+		}
+	}
+
+	public abstract void handleSuccess(Object object);
+
+	public abstract void handleError(Request request, Throwable exception);
+
+	public abstract Object deserialize(Response response);
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/RestException.java b/gss/src/gr/ebs/gss/client/rest/RestException.java
new file mode 100644
index 0000000..cfbbe57
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/RestException.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+
+
+/**
+ * @author kman
+ *
+ */
+public class RestException extends Throwable{
+
+	private int httpStatusCode;
+    private String httpStatusText;
+    private String text;
+    private String path;
+    public RestException() {
+    }
+
+    public RestException(String message) {
+            super(message);
+    }
+
+    public RestException(Throwable innerException) {
+            super(innerException);
+    }
+
+    public RestException(String message, Throwable innerException) {
+            super(message, innerException);
+    }
+
+    public RestException(String path, int httpStatusCode, String httpStatusText, String text) {
+            super("HTTP error: " + httpStatusCode+"\nPapth:"+path + "\nStatus text:" + httpStatusText + "\nText:" + text);
+            this.httpStatusCode = httpStatusCode;
+            this.httpStatusText = httpStatusText;
+            this.path = path;
+            this.text = text;
+    }
+
+    public int getHttpStatusCode() {
+            return httpStatusCode;
+    }
+
+    public String getHttpStatusText() {
+            return httpStatusText;
+    }
+
+    public String getText() {
+            return text;
+    }
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/RestGetCallback.java b/gss/src/gr/ebs/gss/client/rest/RestGetCallback.java
new file mode 100644
index 0000000..4e9719d
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/RestGetCallback.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest;
+
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.RequestCallback;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+/**
+ * @author kman
+ */
+public abstract class RestGetCallback implements RequestCallback {
+
+	private static final int HTTP_OK = 200;
+
+	private AsyncCallback callback;
+	private String path;
+	private int okcode = -1;
+	public RestGetCallback(String path, AsyncCallback callback) {
+		this.callback = callback;
+		this.path = path;
+	}
+
+	public RestGetCallback(String path, AsyncCallback callback, int okCode) {
+		this.callback = callback;
+		this.path = path;
+		okcode = okCode;
+	}
+
+	public void onError(Request request, Throwable exception) {
+		callback.onFailure(exception);
+	}
+
+	public void onResponseReceived(Request request, Response response) {
+		try {
+			if (okcode == -1 && response.getStatusCode() == HTTP_OK)
+				callback.onSuccess(deserialize(response));
+			//this one is only used for trash handling where empty trash has 201 status code
+			else if(okcode !=-1 && (response.getStatusCode() == okcode || response.getStatusCode() == HTTP_OK))
+				callback.onSuccess(deserialize(response));
+			else
+				callback.onFailure(new RestException(path, response.getStatusCode(), response.getStatusText(), response.getText()));
+		} catch (Exception e) {
+			callback.onFailure(e);
+		}
+	}
+
+	public abstract Object deserialize(Response response);
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/FileResource.java b/gss/src/gr/ebs/gss/client/rest/resource/FileResource.java
new file mode 100644
index 0000000..c07e4f8
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/FileResource.java
@@ -0,0 +1,439 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.http.client.URL;
+import com.google.gwt.i18n.client.NumberFormat;
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONString;
+
+/**
+ * @author kman
+ */
+public class FileResource extends RestResource {
+
+	/**
+	 * @param path
+	 */
+	public FileResource(String path) {
+		super(path);
+		// TODO Auto-generated constructor stub
+	}
+
+	String name;
+
+	String owner;
+
+	String createdBy;
+
+	String modifiedBy;
+
+	Date creationDate;
+
+	Date modificationDate;
+
+	String contentType;
+
+	Long contentLength;
+
+	boolean readForAll;
+
+	boolean versioned;
+
+	Integer version;
+
+	String etag;
+
+	boolean deleted = false;
+
+	List tags = new ArrayList();
+
+	Set permissions = new HashSet();
+
+	String folderURI;
+
+	/**
+	 * Retrieve the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Modify the name.
+	 *
+	 * @param name the name to set
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Retrieve the owner.
+	 *
+	 * @return the owner
+	 */
+	public String getOwner() {
+		return owner;
+	}
+
+	/**
+	 * Modify the owner.
+	 *
+	 * @param owner the owner to set
+	 */
+	public void setOwner(String owner) {
+		this.owner = owner;
+	}
+
+	/**
+	 * Retrieve the createdBy.
+	 *
+	 * @return the createdBy
+	 */
+	public String getCreatedBy() {
+		return createdBy;
+	}
+
+	/**
+	 * Modify the createdBy.
+	 *
+	 * @param createdBy the createdBy to set
+	 */
+	public void setCreatedBy(String createdBy) {
+		this.createdBy = createdBy;
+	}
+
+	/**
+	 * Retrieve the modifiedBy.
+	 *
+	 * @return the modifiedBy
+	 */
+	public String getModifiedBy() {
+		return modifiedBy;
+	}
+
+	/**
+	 * Modify the modifiedBy.
+	 *
+	 * @param modifiedBy the modifiedBy to set
+	 */
+	public void setModifiedBy(String modifiedBy) {
+		this.modifiedBy = modifiedBy;
+	}
+
+	/**
+	 * Retrieve the creationDate.
+	 *
+	 * @return the creationDate
+	 */
+	public Date getCreationDate() {
+		return creationDate;
+	}
+
+	/**
+	 * Modify the creationDate.
+	 *
+	 * @param creationDate the creationDate to set
+	 */
+	public void setCreationDate(Date creationDate) {
+		this.creationDate = creationDate;
+	}
+
+	/**
+	 * Retrieve the modificationDate.
+	 *
+	 * @return the modificationDate
+	 */
+	public Date getModificationDate() {
+		return modificationDate;
+	}
+
+	/**
+	 * Modify the modificationDate.
+	 *
+	 * @param modificationDate the modificationDate to set
+	 */
+	public void setModificationDate(Date modificationDate) {
+		this.modificationDate = modificationDate;
+	}
+
+	/**
+	 * Retrieve the contentType.
+	 *
+	 * @return the contentType
+	 */
+	public String getContentType() {
+		return contentType;
+	}
+
+	/**
+	 * Modify the contentType.
+	 *
+	 * @param contentType the contentType to set
+	 */
+	public void setContentType(String contentType) {
+		this.contentType = contentType;
+	}
+
+	/**
+	 * Retrieve the contentLength.
+	 *
+	 * @return the contentLength
+	 */
+	public Long getContentLength() {
+		return contentLength;
+	}
+
+	/**
+	 * Modify the contentLength.
+	 *
+	 * @param contentLength the contentLength to set
+	 */
+	public void setContentLength(Long contentLength) {
+		this.contentLength = contentLength;
+	}
+
+	/**
+	 * Retrieve the readForAll.
+	 *
+	 * @return the readForAll
+	 */
+	public boolean isReadForAll() {
+		return readForAll;
+	}
+
+	/**
+	 * Modify the readForAll.
+	 *
+	 * @param readForAll the readForAll to set
+	 */
+	public void setReadForAll(boolean readForAll) {
+		this.readForAll = readForAll;
+	}
+
+	/**
+	 * Retrieve the versioned.
+	 *
+	 * @return the versioned
+	 */
+	public boolean isVersioned() {
+		return versioned;
+	}
+
+	/**
+	 * Modify the versioned.
+	 *
+	 * @param versioned the versioned to set
+	 */
+	public void setVersioned(boolean versioned) {
+		this.versioned = versioned;
+	}
+
+	/**
+	 * Retrieve the version.
+	 *
+	 * @return the version
+	 */
+	public Integer getVersion() {
+		return version;
+	}
+
+	/**
+	 * Modify the version.
+	 *
+	 * @param version the version to set
+	 */
+	public void setVersion(Integer version) {
+		this.version = version;
+	}
+
+	/**
+	 * Retrieve the etag.
+	 *
+	 * @return the etag
+	 */
+	public String getEtag() {
+		return etag;
+	}
+
+	/**
+	 * Modify the etag.
+	 *
+	 * @param etag the etag to set
+	 */
+	public void setEtag(String etag) {
+		this.etag = etag;
+	}
+
+	/**
+	 * Retrieve the tags.
+	 *
+	 * @return the tags
+	 */
+	public List getTags() {
+		return tags;
+	}
+
+	/**
+	 * Modify the tags.
+	 *
+	 * @param tags the tags to set
+	 */
+	public void setTags(List tags) {
+		this.tags = tags;
+	}
+
+	/**
+	 * Retrieve the permissions.
+	 *
+	 * @return the permissions
+	 */
+	public Set getPermissions() {
+		return permissions;
+	}
+
+	/**
+	 * Modify the permissions.
+	 *
+	 * @param permissions the permissions to set
+	 */
+	public void setPermissions(Set permissions) {
+		this.permissions = permissions;
+	}
+
+	/**
+	 * Retrieve the deleted.
+	 *
+	 * @return the deleted
+	 */
+	public boolean isDeleted() {
+		return deleted;
+	}
+
+	/**
+	 * Modify the deleted.
+	 *
+	 * @param deleted the deleted to set
+	 */
+	public void setDeleted(boolean deleted) {
+		this.deleted = deleted;
+	}
+
+	/**
+	 * Retrieve the folderURI.
+	 *
+	 * @return the folderURI
+	 */
+	public String getFolderURI() {
+		return folderURI;
+	}
+
+	/**
+	 * Modify the folderURI.
+	 *
+	 * @param folderURI the folderURI to set
+	 */
+	public void setFolderURI(String folderURI) {
+		this.folderURI = folderURI;
+	}
+
+	public void createFromJSON(String text) {
+		JSONObject metadata = (JSONObject) JSONParser.parse(text);
+		name = unmarshallString(metadata, "name");
+		name = URL.decodeComponent(name);
+		owner = unmarshallString(metadata, "owner");
+		readForAll = unmarshallBoolean(metadata, "readForAll");
+		versioned = unmarshallBoolean(metadata, "versioned");
+
+		if (metadata.get("version") != null)
+			version = new Integer(metadata.get("version").toString());
+
+		folderURI = unmarshallString(metadata, "folder");
+		deleted = unmarshallBoolean(metadata, "deleted");
+		if (deleted)
+			GWT.log("FOUND A DELETED FILE:" + name, null);
+
+		if (metadata.get("permissions") != null) {
+			JSONArray perm = metadata.get("permissions").isArray();
+			if (perm != null)
+				for (int i = 0; i < perm.size(); i++) {
+					JSONObject obj = perm.get(i).isObject();
+					if (obj != null) {
+						PermissionHolder permission = new PermissionHolder();
+						if (obj.get("user") != null)
+							permission.setUser(unmarshallString(obj, "user"));
+						if (obj.get("group") != null)
+							permission.setGroup(unmarshallString(obj, "group"));
+						permission.setRead(unmarshallBoolean(obj, "read"));
+						permission.setWrite(unmarshallBoolean(obj, "write"));
+						permission.setModifyACL(unmarshallBoolean(obj, "modifyACL"));
+						permissions.add(permission);
+					}
+				}
+
+		}
+		if (metadata.get("tags") != null) {
+			JSONArray perm = metadata.get("tags").isArray();
+			if (perm != null)
+				for (int i = 0; i < perm.size(); i++) {
+					JSONString obj = perm.get(i).isString();
+					if(obj != null)
+						tags.add(obj.stringValue());
+				}
+		}
+		if (metadata.get("creationDate") != null)
+			creationDate = new Date(new Long(metadata.get("creationDate").toString()));
+		if (metadata.get("modificationDate") != null)
+			modificationDate = new Date(new Long(metadata.get("modificationDate").toString()));
+	}
+
+	/**
+	 * Return the file size in a humanly readable form, using SI units to denote
+	 * size information, e.g. 1 KB = 1000 B (bytes).
+	 *
+	 * @return the fileSize
+	 */
+	public String getFileSizeAsString() {
+		if (contentLength < 1024)
+			return String.valueOf(contentLength) + " B";
+		else if (contentLength <= 1024 * 1024)
+			return getSize(contentLength, 1024D) + " KB";
+		else if (contentLength <= 1024 * 1024 * 1024)
+			return getSize(contentLength, (1024D * 1024D)) + " MB";
+		return getSize(contentLength, (1024D * 1024D * 1024D)) + " GB";
+	}
+
+	private String getSize(Long size, Double division) {
+		Double res = Double.valueOf(size.toString()) / division;
+		NumberFormat nf = NumberFormat.getFormat("######.###");
+		return nf.format(res);
+	}
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/FolderResource.java b/gss/src/gr/ebs/gss/client/rest/resource/FolderResource.java
new file mode 100644
index 0000000..1c6f69d
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/FolderResource.java
@@ -0,0 +1,434 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+
+package gr.ebs.gss.client.rest.resource;
+
+import gr.ebs.gss.client.GSS;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+
+/**
+ * @author kman
+ */
+public class FolderResource extends RestResource {
+
+	/**
+	 * @param path
+	 */
+	public FolderResource(String path) {
+		super(path);
+	}
+
+	String name;
+
+	String owner;
+
+	String createdBy;
+
+	String modifiedBy;
+
+	Date creationDate;
+
+	Date modificationDate;
+
+	List filePaths = new LinkedList();
+
+	List subfolderPaths = new LinkedList();
+
+	Set permissions = new HashSet();
+
+	List folders = new ArrayList();
+
+	List files = new ArrayList();
+
+	String parentURI;
+
+	boolean deleted = false;
+
+	boolean needsExpanding = false;
+
+	/**
+	 * Retrieve the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Modify the name.
+	 *
+	 * @param name the name to set
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Retrieve the owner.
+	 *
+	 * @return the owner
+	 */
+	public String getOwner() {
+		return owner;
+	}
+
+	/**
+	 * Modify the owner.
+	 *
+	 * @param owner the owner to set
+	 */
+	public void setOwner(String owner) {
+		this.owner = owner;
+	}
+
+	/**
+	 * Retrieve the createdBy.
+	 *
+	 * @return the createdBy
+	 */
+	public String getCreatedBy() {
+		return createdBy;
+	}
+
+	/**
+	 * Modify the createdBy.
+	 *
+	 * @param createdBy the createdBy to set
+	 */
+	public void setCreatedBy(String createdBy) {
+		this.createdBy = createdBy;
+	}
+
+	/**
+	 * Retrieve the modifiedBy.
+	 *
+	 * @return the modifiedBy
+	 */
+	public String getModifiedBy() {
+		return modifiedBy;
+	}
+
+	/**
+	 * Modify the modifiedBy.
+	 *
+	 * @param modifiedBy the modifiedBy to set
+	 */
+	public void setModifiedBy(String modifiedBy) {
+		this.modifiedBy = modifiedBy;
+	}
+
+	/**
+	 * Retrieve the creationDate.
+	 *
+	 * @return the creationDate
+	 */
+	public Date getCreationDate() {
+		return creationDate;
+	}
+
+	/**
+	 * Modify the creationDate.
+	 *
+	 * @param creationDate the creationDate to set
+	 */
+	public void setCreationDate(Date creationDate) {
+		this.creationDate = creationDate;
+	}
+
+	/**
+	 * Retrieve the modificationDate.
+	 *
+	 * @return the modificationDate
+	 */
+	public Date getModificationDate() {
+		return modificationDate;
+	}
+
+	/**
+	 * Modify the modificationDate.
+	 *
+	 * @param modificationDate the modificationDate to set
+	 */
+	public void setModificationDate(Date modificationDate) {
+		this.modificationDate = modificationDate;
+	}
+
+	/**
+	 * Retrieve the filePaths.
+	 *
+	 * @return the filePaths
+	 */
+	public List getFilePaths() {
+		return filePaths;
+	}
+
+	/**
+	 * Modify the filePaths.
+	 *
+	 * @param filePaths the filePaths to set
+	 */
+	public void setFilePaths(List filePaths) {
+		this.filePaths = filePaths;
+	}
+
+	/**
+	 * Retrieve the subfolderPaths.
+	 *
+	 * @return the subfolderPaths
+	 */
+	public List getSubfolderPaths() {
+		return subfolderPaths;
+	}
+
+	/**
+	 * Modify the subfolderPaths.
+	 *
+	 * @param subfolderPaths the subfolderPaths to set
+	 */
+	public void setSubfolderPaths(List subfolderPaths) {
+		this.subfolderPaths = subfolderPaths;
+	}
+
+	/**
+	 * Retrieve the permissions.
+	 *
+	 * @return the permissions
+	 */
+	public Set getPermissions() {
+		return permissions;
+	}
+
+	/**
+	 * Modify the permissions.
+	 *
+	 * @param permissions the permissions to set
+	 */
+	public void setPermissions(Set permissions) {
+		this.permissions = permissions;
+	}
+
+	/**
+	 * Retrieve the deleted.
+	 *
+	 * @return the deleted
+	 */
+	public boolean isDeleted() {
+		return deleted;
+	}
+
+	/**
+	 * Modify the deleted.
+	 *
+	 * @param deleted the deleted to set
+	 */
+	public void setDeleted(boolean deleted) {
+		this.deleted = deleted;
+	}
+
+	public void removeSubfolderPath(String spath) {
+		if (subfolderPaths.remove(spath))
+			return;
+		else if (subfolderPaths.remove(spath + "/"))
+			return;
+		else
+			subfolderPaths.remove(spath.substring(0, spath.length() - 1));
+	}
+
+	/**
+	 * Retrieve the folders.
+	 *
+	 * @return the folders
+	 */
+	public List getFolders() {
+		return folders;
+	}
+
+	/**
+	 * Modify the folders.
+	 *
+	 * @param folders the folders to set
+	 */
+	public void setFolders(List folders) {
+		this.folders = folders;
+	}
+
+	/**
+	 * Retrieve the files.
+	 *
+	 * @return the files
+	 */
+	public List getFiles() {
+		return files;
+	}
+
+	/**
+	 * Modify the files.
+	 *
+	 * @param files the files to set
+	 */
+	public void setFiles(List files) {
+		this.files = files;
+	}
+
+	/**
+	 * Retrieve the parentURI.
+	 *
+	 * @return the parentURI
+	 */
+	public String getParentURI() {
+		return parentURI;
+	}
+
+	/**
+	 * Modify the parentURI.
+	 *
+	 * @param parentURI the parentURI to set
+	 */
+	public void setParentURI(String parentURI) {
+		this.parentURI = parentURI;
+	}
+
+	public void createFromJSON(String text) {
+
+		JSONObject json = (JSONObject) JSONParser.parse(text);
+		name = unmarshallString(json, "name");
+		// name = URL.decodeComponent(name);
+		owner = unmarshallString(json, "owner");
+		parentURI = unmarshallString(json, "parent");
+		deleted = unmarshallBoolean(json, "deleted");
+		if (deleted)
+			GWT.log("FOUND A DELETED FOLDER:" + name, null);
+
+		if (json.get("permissions") != null) {
+			JSONArray perm = json.get("permissions").isArray();
+			if (perm != null)
+				for (int i = 0; i < perm.size(); i++) {
+					JSONObject obj = perm.get(i).isObject();
+					if (obj != null) {
+						PermissionHolder permission = new PermissionHolder();
+						if (obj.get("user") != null)
+							permission.setUser(unmarshallString(obj, "user"));
+						if (obj.get("group") != null)
+							permission.setGroup(unmarshallString(obj, "group"));
+						permission.setRead(unmarshallBoolean(obj, "read"));
+						permission.setWrite(unmarshallBoolean(obj, "write"));
+						permission.setModifyACL(unmarshallBoolean(obj, "modifyACL"));
+						permissions.add(permission);
+					}
+
+				}
+		}
+		if (json.get("folders") != null) {
+			JSONArray subs = json.get("folders").isArray();
+			if (subs != null)
+				for (int i = 0; i < subs.size(); i++) {
+					JSONObject so = subs.get(i).isObject();
+					if (so != null) {
+						String subUri = unmarshallString(so, "uri");
+						String subName = unmarshallString(so, "name");
+						if (subUri != null && subName != null) {
+							if (!subUri.endsWith("/"))
+								subUri = subUri + "/";
+							FolderResource sub = new FolderResource(subUri);
+							sub.setName(subName);
+							sub.setNeedsExpanding(true);
+							folders.add(sub);
+							subfolderPaths.add(subUri);
+						}
+
+					}
+				}
+		}
+		if (json.get("files") != null) {
+			JSONArray subs = json.get("files").isArray();
+			if (subs != null)
+				for (int i = 0; i < subs.size(); i++) {
+					JSONObject fo = subs.get(i).isObject();
+					if (fo != null) {
+						String fname = unmarshallString(fo, "name");
+						String fowner = unmarshallString(fo, "owner");
+
+						Integer fversion = null;
+						if (fo.get("version") != null)
+							fversion = new Integer(fo.get("version").toString());
+						boolean fdeleted = unmarshallBoolean(fo, "deleted");
+						Date fcreationDate = null;
+						if (fo.get("creationDate") != null)
+							fcreationDate = new Date(new Long(fo.get("creationDate").toString()));
+						String furi = unmarshallString(fo, "uri");
+						Long fsize = 0L;
+						if (fo.get("size") != null)
+							fsize = new Long(fo.get("size").toString());
+						filePaths.add(furi);
+						FileResource fs = new FileResource(furi);
+						fs.setName(fname);
+						fs.setOwner(fowner);
+
+						fs.setVersion(fversion);
+						fs.setContentLength(fsize);
+						fs.setDeleted(fdeleted);
+						fs.setCreationDate(fcreationDate);
+						files.add(fs);
+					}
+				}
+		}
+		if (json.get("creationDate") != null)
+			creationDate = new Date(new Long(json.get("creationDate").toString()));
+		if (json.get("modificationDate") != null)
+			modificationDate = new Date(new Long(json.get("modificationDate").toString()));
+
+	}
+
+	public String getParent() {
+		String base = GSS.GSS_REST_PATH;
+		int length = base.length();
+		return path.substring(length, path.length());
+	}
+
+	/**
+	 * Retrieve the needsExpanding.
+	 *
+	 * @return the needsExpanding
+	 */
+	public boolean isNeedsExpanding() {
+		return needsExpanding;
+	}
+
+	/**
+	 * Modify the needsExpanding.
+	 *
+	 * @param needsExpanding the needsExpanding to set
+	 */
+	public void setNeedsExpanding(boolean needsExpanding) {
+		this.needsExpanding = needsExpanding;
+	}
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/GroupResource.java b/gss/src/gr/ebs/gss/client/rest/resource/GroupResource.java
new file mode 100644
index 0000000..24a2be7
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/GroupResource.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONParser;
+
+/**
+ * @author kman
+ */
+public class GroupResource extends RestResource {
+
+	/**
+	 * @param path
+	 */
+	public GroupResource(String path) {
+		super(path);
+	}
+
+	List userPaths = new ArrayList();
+
+	/**
+	 * Retrieve the userPaths.
+	 *
+	 * @return the userPaths
+	 */
+	public List getUserPaths() {
+		return userPaths;
+	}
+
+	/**
+	 * Modify the userPaths.
+	 *
+	 * @param userPaths the userPaths to set
+	 */
+	public void setUserPaths(List userPaths) {
+		this.userPaths = userPaths;
+	}
+
+	public void createFromJSON(String text) {
+		JSONArray array = (JSONArray) JSONParser.parse(text);
+		if (array != null)
+			for (int i = 0; i < array.size(); i++)
+				if(array.get(i).isString() != null)
+					getUserPaths().add(array.get(i).isString().stringValue());
+
+	}
+
+	public String getName() {
+		String[] names = path.split("/");
+		return names[names.length - 1];
+	}
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/GroupUserResource.java b/gss/src/gr/ebs/gss/client/rest/resource/GroupUserResource.java
new file mode 100644
index 0000000..2c535ec
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/GroupUserResource.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+
+
+/**
+ * @author kman
+ *
+ */
+public class GroupUserResource extends RestResource{
+	/**
+	 * @param path
+	 */
+	public GroupUserResource(String path) {
+		super(path);
+	}
+
+	String username;
+	String name;
+	String home;
+
+
+
+	/**
+	 * Retrieve the username.
+	 *
+	 * @return the username
+	 */
+	public String getUsername() {
+		return username;
+	}
+
+	/**
+	 * Modify the username.
+	 *
+	 * @param username the username to set
+	 */
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	/**
+	 * Retrieve the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Modify the name.
+	 *
+	 * @param name the name to set
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Retrieve the home.
+	 *
+	 * @return the home
+	 */
+	public String getHome() {
+		return home;
+	}
+
+	/**
+	 * Modify the home.
+	 *
+	 * @param home the home to set
+	 */
+	public void setHome(String home) {
+		this.home = home;
+	}
+
+	public void createFromJSON(String text) {
+		JSONObject json = (JSONObject) JSONParser.parse(text);
+		name = unmarshallString(json, "name");
+		home = unmarshallString(json, "home");
+		username = unmarshallString(json, "username");
+	}
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/GroupsResource.java b/gss/src/gr/ebs/gss/client/rest/resource/GroupsResource.java
new file mode 100644
index 0000000..6c4ab41
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/GroupsResource.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+
+/**
+ * @author kman
+ */
+public class GroupsResource extends RestResource {
+
+	/**
+	 * @param path
+	 */
+	public GroupsResource(String path) {
+		super(path);
+	}
+
+	List groupPaths = new ArrayList();
+
+	/**
+	 * Retrieve the groupPaths.
+	 *
+	 * @return the groupPaths
+	 */
+	public List getGroupPaths() {
+		return groupPaths;
+	}
+
+	/**
+	 * Modify the groupPaths.
+	 *
+	 * @param groupPaths the groupPaths to set
+	 */
+	public void setGroupPaths(List groupPaths) {
+		this.groupPaths = groupPaths;
+	}
+
+	public void createFromJSON(String text) {
+		JSONArray array = (JSONArray) JSONParser.parse(text);
+		if (array != null)
+			for (int i = 0; i < array.size(); i++) {
+				JSONObject js = array.get(i).isObject();
+				if(js != null){
+					String uri = unmarshallString(js, "uri");
+					if(uri != null)
+						getGroupPaths().add(uri);
+				}
+			}
+
+	}
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/OtherUserResource.java b/gss/src/gr/ebs/gss/client/rest/resource/OtherUserResource.java
new file mode 100644
index 0000000..5c1c63f
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/OtherUserResource.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+
+
+/**
+ * @author kman
+ *
+ */
+public class OtherUserResource extends RestResource{
+	/**
+	 * @param path
+	 */
+	public OtherUserResource(String path) {
+		super(path);
+	}
+	String username;
+
+
+	List filePaths = new LinkedList();
+	List subfolderPaths = new LinkedList();
+	List folders = new ArrayList();
+
+	List files = new ArrayList();
+
+
+
+
+	/**
+	 * Retrieve the username.
+	 *
+	 * @return the username
+	 */
+	public String getUsername() {
+		return username;
+	}
+
+
+	/**
+	 * Modify the username.
+	 *
+	 * @param username the username to set
+	 */
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	/**
+	 * Retrieve the files.
+	 *
+	 * @return the files
+	 */
+	public List getFilePaths() {
+		return filePaths;
+	}
+
+	/**
+	 * Modify the files.
+	 *
+	 * @param files the files to set
+	 */
+	public void setFilePaths(List files) {
+		filePaths = files;
+	}
+
+	/**
+	 * Retrieve the subfolders.
+	 *
+	 * @return the subfolders
+	 */
+	public List getSubfolderPaths() {
+		return subfolderPaths;
+	}
+
+	/**
+	 * Modify the subfolders.
+	 *
+	 * @param subfolders the subfolders to set
+	 */
+	public void setSubfolderPaths(List subfolders) {
+		subfolderPaths = subfolders;
+	}
+
+
+	/**
+	 * Retrieve the folders.
+	 *
+	 * @return the folders
+	 */
+	public List getFolders() {
+		return folders;
+	}
+
+
+	/**
+	 * Modify the folders.
+	 *
+	 * @param folders the folders to set
+	 */
+	public void setFolders(List folders) {
+		this.folders = folders;
+	}
+
+
+	/**
+	 * Retrieve the files.
+	 *
+	 * @return the files
+	 */
+	public List getFiles() {
+		return files;
+	}
+
+
+	/**
+	 * Modify the files.
+	 *
+	 * @param files the files to set
+	 */
+	public void setFiles(List files) {
+		this.files = files;
+	}
+
+	public void createFromJSON(String text) {
+		JSONObject json = (JSONObject) JSONParser.parse(text);
+		if (json.get("folders") != null) {
+			JSONArray subs = json.get("folders").isArray();
+			if (subs != null)
+				for (int i = 0; i < subs.size(); i++) {
+					JSONObject so = subs.get(i).isObject();
+					if (so != null) {
+						String subUri = unmarshallString(so, "uri");
+						String subName = unmarshallString(so, "name");
+						if (subUri != null && subName != null) {
+							if (!subUri.endsWith("/"))
+								subUri = subUri + "/";
+							FolderResource sub = new FolderResource(subUri);
+							sub.setName(subName);
+							sub.setNeedsExpanding(true);
+							folders.add(sub);
+							subfolderPaths.add(subUri);
+						}
+
+					}
+				}
+		}
+		if (json.get("files") != null) {
+			JSONArray subs = json.get("files").isArray();
+			if (subs != null)
+				for (int i = 0; i < subs.size(); i++) {
+					JSONObject fo = subs.get(i).isObject();
+					if (fo != null) {
+						String fname = unmarshallString(fo, "name");
+						String fowner = unmarshallString(fo, "owner");
+						String fvs = unmarshallString(fo, "version");
+						Integer fversion = null;
+						if (fo.get("version") != null)
+							fversion = new Integer(fo.get("version").toString());
+						boolean fdeleted = unmarshallBoolean(fo, "deleted");
+						Date fcreationDate = null;
+						if (fo.get("creationDate") != null)
+							fcreationDate = new Date(new Long(fo.get("creationDate").toString()));
+						String furi = unmarshallString(fo,"uri");
+						Long fsize = 0L;
+						if(fo.get("size") != null)
+							fsize = new Long(fo.get("size").toString());
+						filePaths.add(furi);
+						FileResource fs = new FileResource(furi);
+						fs.setName(fname);
+						fs.setOwner(fowner);
+						fs.setVersion(fversion);
+						fs.setContentLength(fsize);
+						fs.setDeleted(fdeleted);
+						fs.setCreationDate(fcreationDate);
+						files.add(fs);
+					}
+				}
+		}
+
+	}
+
+	public String getName(){
+		String[] names = path.split("/");
+		return names[names.length -1];
+	}
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/OthersResource.java b/gss/src/gr/ebs/gss/client/rest/resource/OthersResource.java
new file mode 100644
index 0000000..dc29a36
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/OthersResource.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+
+/**
+ * @author kman
+ */
+public class OthersResource extends RestResource {
+
+	/**
+	 * @param path
+	 */
+	public OthersResource(String path) {
+		super(path);
+	}
+
+	List others = new ArrayList();
+
+	/**
+	 * Retrieve the others.
+	 *
+	 * @return the others
+	 */
+	public List getOthers() {
+		return others;
+	}
+
+	/**
+	 * Modify the others.
+	 *
+	 * @param others the others to set
+	 */
+	public void setOthers(List others) {
+		this.others = others;
+	}
+
+	public void createFromJSON(String text) {
+		JSONArray array = (JSONArray) JSONParser.parse(text);
+		if (array != null)
+			for (int i = 0; i < array.size(); i++) {
+				JSONObject js = array.get(i).isObject();
+				if (js != null) {
+					String uri = unmarshallString(js, "uri");
+					if(uri != null)
+						getOthers().add(uri);
+				}
+			}
+
+	}
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/PermissionHolder.java b/gss/src/gr/ebs/gss/client/rest/resource/PermissionHolder.java
new file mode 100644
index 0000000..7b1c06f
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/PermissionHolder.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.io.Serializable;
+
+
+/**
+ * @author kman
+ *
+ */
+public class PermissionHolder implements Serializable{
+
+	private String user;
+	private String group;
+	private boolean read;
+	private boolean write;
+	private boolean modifyACL;
+
+	/**
+	 * Retrieve the user.
+	 *
+	 * @return the user
+	 */
+	public String getUser() {
+		return user;
+	}
+
+	/**
+	 * Modify the user.
+	 *
+	 * @param user the user to set
+	 */
+	public void setUser(String user) {
+		this.user = user;
+	}
+
+	/**
+	 * Retrieve the group.
+	 *
+	 * @return the group
+	 */
+	public String getGroup() {
+		return group;
+	}
+
+	/**
+	 * Modify the group.
+	 *
+	 * @param group the group to set
+	 */
+	public void setGroup(String group) {
+		this.group = group;
+	}
+
+	/**
+	 * Retrieve the read.
+	 *
+	 * @return the read
+	 */
+	public boolean isRead() {
+		return read;
+	}
+
+	/**
+	 * Modify the read.
+	 *
+	 * @param read the read to set
+	 */
+	public void setRead(boolean read) {
+		this.read = read;
+	}
+
+	/**
+	 * Retrieve the write.
+	 *
+	 * @return the write
+	 */
+	public boolean isWrite() {
+		return write;
+	}
+
+	/**
+	 * Modify the write.
+	 *
+	 * @param write the write to set
+	 */
+	public void setWrite(boolean write) {
+		this.write = write;
+	}
+
+	/**
+	 * Retrieve the modifyACL.
+	 *
+	 * @return the modifyACL
+	 */
+	public boolean isModifyACL() {
+		return modifyACL;
+	}
+
+	/**
+	 * Modify the modifyACL.
+	 *
+	 * @param modifyACL the modifyACL to set
+	 */
+	public void setModifyACL(boolean modifyACL) {
+		this.modifyACL = modifyACL;
+	}
+
+
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/QuotaHolder.java b/gss/src/gr/ebs/gss/client/rest/resource/QuotaHolder.java
new file mode 100644
index 0000000..129f7aa
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/QuotaHolder.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.io.Serializable;
+
+import com.google.gwt.i18n.client.NumberFormat;
+
+
+/**
+ * @author kman
+ *
+ */
+public class QuotaHolder implements Serializable{
+	private Long fileCount = 0L;
+	private Long fileSize = 0L;
+	private Long quotaLeftSize = 0L;
+
+	/**
+	 * Retrieve the fileCount.
+	 *
+	 * @return the fileCount
+	 */
+	public Long getFileCount() {
+		return fileCount;
+	}
+
+	/**
+	 * Modify the fileCount.
+	 *
+	 * @param fileCount the fileCount to set
+	 */
+	public void setFileCount(Long fileCount) {
+		this.fileCount = fileCount;
+	}
+
+	/**
+	 * Retrieve the fileSize.
+	 *
+	 * @return the fileSize
+	 */
+	public Long getFileSize() {
+		return fileSize;
+	}
+
+	/**
+	 * Modify the fileSize.
+	 *
+	 * @param fileSize the fileSize to set
+	 */
+	public void setFileSize(Long fileSize) {
+		this.fileSize = fileSize;
+	}
+
+	/**
+	 * Retrieve the quotaLeftSize.
+	 *
+	 * @return the quotaLeftSize
+	 */
+	public Long getQuotaLeftSize() {
+		return quotaLeftSize;
+	}
+
+	/**
+	 * Modify the quotaLeftSize.
+	 *
+	 * @param quotaLeftSize the quotaLeftSize to set
+	 */
+	public void setQuotaLeftSize(Long quotaLeftSize) {
+		this.quotaLeftSize = quotaLeftSize;
+	}
+	public String getFileSizeAsString() {
+		if (fileSize < 1024)
+			return String.valueOf(fileSize) + " B";
+		else if (fileSize <= 1024*1024)
+			return getSize(fileSize, 1024D) + " KB";
+		else if (fileSize <= 1024*1024*1024)
+			return getSize(fileSize,(1024D*1024D)) + " MB";
+		return getSize(fileSize , (1024D*1024D*1024D)) + " GB";
+	}
+
+	public String getQuotaLeftAsString() {
+		if (quotaLeftSize < 1024)
+			return String.valueOf(quotaLeftSize) + " B";
+		else if (quotaLeftSize <= 1024*1024)
+			return getSize(quotaLeftSize, 1024D) + " KB";
+		else if (quotaLeftSize <= 1024*1024*1024)
+			return getSize(quotaLeftSize,(1024D*1024D)) + " MB";
+		return getSize(quotaLeftSize , (1024D*1024D*1024D)) + " GB";
+	}
+
+	private String getSize(Long size, Double division){
+		Double res = Double.valueOf(size.toString())/division;
+		NumberFormat nf = NumberFormat.getFormat("######.#");
+		return nf.format(res);
+	}
+
+	public long percentOfFreeSpace(){
+		return quotaLeftSize*100/(fileSize+quotaLeftSize);
+	}
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/RestResource.java b/gss/src/gr/ebs/gss/client/rest/resource/RestResource.java
new file mode 100644
index 0000000..38077e2
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/RestResource.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.io.Serializable;
+
+import com.google.gwt.json.client.JSONObject;
+
+
+/**
+ * @author kman
+ *
+ */
+public abstract class RestResource implements Serializable{
+	String path;
+
+
+	/**
+	 * @param path
+	 */
+	public RestResource(String path) {
+		super();
+		this.path = path;
+	}
+
+
+
+
+	/**
+	 * Retrieve the path.
+	 *
+	 * @return the path
+	 */
+	public String getPath() {
+		return path;
+	}
+
+
+
+
+	/**
+	 * Modify the path.
+	 *
+	 * @param path the path to set
+	 */
+	public void setPath(String path) {
+		this.path = path;
+	}
+
+
+
+	public abstract void createFromJSON(String text);
+
+
+	protected String unmarshallString(JSONObject obj, String varName){
+		if(obj.get(varName) != null)
+			if(obj.get(varName).isString() != null)
+				return obj.get(varName).isString().stringValue();
+		return null;
+	}
+
+	protected boolean unmarshallBoolean(JSONObject obj, String varName){
+		if(obj.get(varName) != null)
+			if(obj.get(varName).isBoolean() != null)
+				return obj.get(varName).isBoolean().booleanValue();
+		return false;
+	}
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/SearchResource.java b/gss/src/gr/ebs/gss/client/rest/resource/SearchResource.java
new file mode 100644
index 0000000..04962c8
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/SearchResource.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONParser;
+
+/**
+ * @author kman
+ */
+public class SearchResource extends RestResource {
+
+	/**
+	 * @param path
+	 */
+	public SearchResource(String path) {
+		super(path);
+	}
+
+	List files = new LinkedList();
+
+	/**
+	 * Retrieve the files.
+	 *
+	 * @return the files
+	 */
+	public List getFiles() {
+		return files;
+	}
+
+	/**
+	 * Modify the files.
+	 *
+	 * @param files the files to set
+	 */
+	public void setFiles(List files) {
+		this.files = files;
+	}
+
+	public void createFromJSON(String text) {
+
+		JSONArray subs = JSONParser.parse(text).isArray();
+		if (subs != null)
+			for (int i = 0; i < subs.size(); i++)
+				files.add(subs.get(i).isString().stringValue());
+
+	}
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/SharedResource.java b/gss/src/gr/ebs/gss/client/rest/resource/SharedResource.java
new file mode 100644
index 0000000..49c8dfb
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/SharedResource.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+
+
+/**
+ * @author kman
+ *
+ */
+public class SharedResource extends RestResource{
+
+	/**
+	 * @param path
+	 */
+	public SharedResource(String path) {
+		super(path);
+	}
+
+
+	List filePaths = new LinkedList();
+	List subfolderPaths = new LinkedList();
+	List folders = new ArrayList();
+
+	List files = new ArrayList();
+
+	/**
+	 * Retrieve the files.
+	 *
+	 * @return the files
+	 */
+	public List getFilePaths() {
+		return filePaths;
+	}
+
+	/**
+	 * Modify the files.
+	 *
+	 * @param filepaths the files to set
+	 */
+	public void setFilePaths(List filePaths) {
+		this.filePaths = filePaths;
+	}
+
+	/**
+	 * Retrieve the subfolders.
+	 *
+	 * @return the subfolders
+	 */
+	public List getSubfolderPaths() {
+		return subfolderPaths;
+	}
+
+	/**
+	 * Modify the subfolders.
+	 *
+	 * @param subfolderPaths the subfolders to set
+	 */
+	public void setSubfolderPaths(List subfolderPaths) {
+		this.subfolderPaths = subfolderPaths;
+	}
+
+
+	/**
+	 * Retrieve the folders.
+	 *
+	 * @return the folders
+	 */
+	public List getFolders() {
+		return folders;
+	}
+
+
+	/**
+	 * Modify the folders.
+	 *
+	 * @param folders the folders to set
+	 */
+	public void setFolders(List folders) {
+		this.folders = folders;
+	}
+
+
+	/**
+	 * Retrieve the files.
+	 *
+	 * @return the files
+	 */
+	public List getFiles() {
+		return files;
+	}
+
+
+	/**
+	 * Modify the files.
+	 *
+	 * @param files the files to set
+	 */
+	public void setFiles(List files) {
+		this.files = files;
+	}
+
+	public void createFromJSON(String text) {
+		JSONObject json = (JSONObject) JSONParser.parse(text);
+		if (json.get("folders") != null) {
+			JSONArray subs = json.get("folders").isArray();
+			if (subs != null)
+				for (int i = 0; i < subs.size(); i++) {
+					JSONObject so = subs.get(i).isObject();
+					if (so != null) {
+						String subUri = unmarshallString(so, "uri");
+						String subName = unmarshallString(so, "name");
+						if (subUri != null && subName != null) {
+							if (!subUri.endsWith("/"))
+								subUri = subUri + "/";
+							FolderResource sub = new FolderResource(subUri);
+							sub.setName(subName);
+							sub.setNeedsExpanding(true);
+							folders.add(sub);
+							subfolderPaths.add(subUri);
+						}
+
+					}
+				}
+		}
+		if (json.get("files") != null) {
+			JSONArray subs = json.get("files").isArray();
+			if (subs != null)
+				for (int i = 0; i < subs.size(); i++) {
+					JSONObject fo = subs.get(i).isObject();
+					if (fo != null) {
+						String fname = unmarshallString(fo, "name");
+						String fowner = unmarshallString(fo, "owner");
+						String fvs = unmarshallString(fo, "version");
+						Integer fversion = null;
+						if (fo.get("version") != null)
+							fversion = new Integer(fo.get("version").toString());
+						boolean fdeleted = unmarshallBoolean(fo, "deleted");
+						Date fcreationDate = null;
+						if (fo.get("creationDate") != null)
+							fcreationDate = new Date(new Long(fo.get("creationDate").toString()));
+						String furi = unmarshallString(fo,"uri");
+						Long fsize = 0L;
+						if(fo.get("size") != null)
+							fsize = new Long(fo.get("size").toString());
+						filePaths.add(furi);
+						FileResource fs = new FileResource(furi);
+						fs.setName(fname);
+						fs.setOwner(fowner);
+						fs.setVersion(fversion);
+						fs.setContentLength(fsize);
+						fs.setDeleted(fdeleted);
+						fs.setCreationDate(fcreationDate);
+						files.add(fs);
+					}
+				}
+		}
+
+	}
+
+
+	public List getRootSharedFiles(){
+		List res = new ArrayList();
+		for(String f : getFilePaths()){
+			boolean contained = false;
+			for(String fo : getSubfolderPaths())
+				if(f.startsWith(fo))
+					contained = true;
+			if(!contained)
+				res.add(f);
+		}
+		return res;
+	}
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/TagsResource.java b/gss/src/gr/ebs/gss/client/rest/resource/TagsResource.java
new file mode 100644
index 0000000..3f1e6b7
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/TagsResource.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONParser;
+
+
+/**
+ * @author kman
+ *
+ */
+public class TagsResource extends RestResource{
+
+	/**
+	 * @param path
+	 */
+	public TagsResource(String path) {
+		super(path);
+	}
+
+	List tags = new ArrayList();
+
+
+	/**
+	 * Retrieve the tags.
+	 *
+	 * @return the tags
+	 */
+	public List getTags() {
+		return tags;
+	}
+
+	/**
+	 * Modify the tags.
+	 *
+	 * @param tags the tags to set
+	 */
+	public void setTags(List tags) {
+		this.tags = tags;
+	}
+
+	public void createFromJSON(String text) {
+		JSONArray array = (JSONArray) JSONParser.parse(text);
+		if(array != null)
+			for (int i = 0; i < array.size(); i++)
+				getTags().add(array.get(i).isString().stringValue());
+
+	}
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/TrashResource.java b/gss/src/gr/ebs/gss/client/rest/resource/TrashResource.java
new file mode 100644
index 0000000..720598d
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/TrashResource.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.google.gwt.http.client.URL;
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+
+
+/**
+ * @author kman
+ *
+ */
+public class TrashResource extends RestResource{
+
+	/**
+	 * @param path
+	 */
+	public TrashResource(String path) {
+		super(path);
+	}
+
+	List filePaths = new LinkedList();
+	List subfolderPaths = new LinkedList();
+	List folders = new ArrayList();
+	List files = new ArrayList();
+
+
+	/**
+	 * Retrieve the files.
+	 *
+	 * @return the files
+	 */
+	public List getFilePaths() {
+		return filePaths;
+	}
+
+	/**
+	 * Modify the files.
+	 *
+	 * @param filePaths the files to set
+	 */
+	public void setFilePaths(List filePaths) {
+		filePaths = filePaths;
+	}
+
+	/**
+	 * Retrieve the subfolders.
+	 *
+	 * @return the subfolders
+	 */
+	public List getSubfolderPaths() {
+		return subfolderPaths;
+	}
+
+	/**
+	 * Modify the subfolders.
+	 *
+	 * @param subfolders the subfolders to set
+	 */
+	public void setSubfolderPaths(List subfolderPaths) {
+		subfolderPaths = subfolderPaths;
+	}
+
+
+	/**
+	 * Retrieve the folders.
+	 *
+	 * @return the folders
+	 */
+	public List getFolders() {
+		return folders;
+	}
+
+
+	/**
+	 * Modify the folders.
+	 *
+	 * @param folders the folders to set
+	 */
+	public void setFolders(List folders) {
+		this.folders = folders;
+	}
+
+
+	/**
+	 * Retrieve the files.
+	 *
+	 * @return the files
+	 */
+	public List getFiles() {
+		return files;
+	}
+
+
+	/**
+	 * Modify the files.
+	 *
+	 * @param files the files to set
+	 */
+	public void setFiles(List files) {
+		this.files = files;
+	}
+
+	public void createFromJSON(String text) {
+		JSONObject json = (JSONObject) JSONParser.parse(text);
+		if (json.get("folders") != null) {
+			JSONArray subs = json.get("folders").isArray();
+			if (subs != null)
+				for (int i = 0; i < subs.size(); i++) {
+					JSONObject so = subs.get(i).isObject();
+					if (so != null) {
+						String subUri = unmarshallString(so, "uri");
+						String subName = unmarshallString(so, "name");
+						if (subUri != null && subName != null) {
+							if (!subUri.endsWith("/"))
+								subUri = subUri + "/";
+							FolderResource sub = new FolderResource(subUri);
+							sub.setName(subName);
+							sub.setNeedsExpanding(true);
+							folders.add(sub);
+							subfolderPaths.add(subUri);
+						}
+
+					}
+				}
+		}
+		if (json.get("files") != null) {
+			JSONArray subs = json.get("files").isArray();
+			if (subs != null)
+				for (int i = 0; i < subs.size(); i++) {
+					JSONObject fo = subs.get(i).isObject();
+					if (fo != null) {
+						String fname = unmarshallString(fo, "name");
+						String fowner = unmarshallString(fo, "owner");
+						String fvs = unmarshallString(fo, "version");
+						Integer fversion = null;
+						if (fo.get("version") != null)
+							fversion = new Integer(fo.get("version").toString());
+						boolean fdeleted = unmarshallBoolean(fo, "deleted");
+						Date fcreationDate = null;
+						if (fo.get("creationDate") != null)
+							fcreationDate = new Date(new Long(fo.get("creationDate").toString()));
+						String furi = unmarshallString(fo,"uri");
+						Long fsize = 0L;
+						if(fo.get("size") != null)
+							fsize = new Long(fo.get("size").toString());
+						filePaths.add(furi);
+						FileResource fs = new FileResource(furi);
+						fs.setName(fname);
+						fs.setOwner(fowner);
+						fs.setVersion(fversion);
+						fs.setContentLength(fsize);
+						fs.setDeleted(fdeleted);
+						fs.setCreationDate(fcreationDate);
+						files.add(fs);
+					}
+				}
+		}
+	}
+
+	public List getTrashedFolders(){
+		List res = new ArrayList();
+		for(String s : subfolderPaths){
+			String[] pathElements =  s.split("/");
+			FolderResource tr = new FolderResource(s);
+			tr.setName(URL.decodeComponent(pathElements[pathElements.length-1]));
+			res.add(tr);
+		}
+		return res;
+	}
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/UploadStatusResource.java b/gss/src/gr/ebs/gss/client/rest/resource/UploadStatusResource.java
new file mode 100644
index 0000000..48515e7
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/UploadStatusResource.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+
+
+/**
+ * @author kman
+ *
+ */
+public class UploadStatusResource extends RestResource{
+	long bytesTransferred;
+	long fileSize;
+
+	/**
+	 * @param path
+	 */
+	public UploadStatusResource(String path) {
+		super(path);
+	}
+
+
+	/**
+	 * Retrieve the bytesTransferred.
+	 *
+	 * @return the bytesTransferred
+	 */
+	public long getBytesTransferred() {
+		return bytesTransferred;
+	}
+
+	/**
+	 * Modify the bytesTransferred.
+	 *
+	 * @param bytesTransferred the bytesTransferred to set
+	 */
+	public void setBytesTransferred(long bytesTransferred) {
+		this.bytesTransferred = bytesTransferred;
+	}
+
+	/**
+	 * Retrieve the fileSize.
+	 *
+	 * @return the fileSize
+	 */
+	public long getFileSize() {
+		return fileSize;
+	}
+
+	/**
+	 * Modify the fileSize.
+	 *
+	 * @param fileSize the fileSize to set
+	 */
+	public void setFileSize(long fileSize) {
+		this.fileSize = fileSize;
+	}
+
+	public int percent(){
+		return new Long(bytesTransferred*100/fileSize).intValue();
+	}
+
+	@Override
+	public void createFromJSON(String text) {
+		JSONObject json = (JSONObject) JSONParser.parse(text);
+		if(json.get("bytesTotal") != null)
+			fileSize = new Long(json.get("bytesTotal").toString());
+		if(json.get("bytesUploaded") != null)
+			bytesTransferred = new Long(json.get("bytesUploaded").toString());
+
+	}
+
+}
diff --git a/gss/src/gr/ebs/gss/client/rest/resource/UserResource.java b/gss/src/gr/ebs/gss/client/rest/resource/UserResource.java
new file mode 100644
index 0000000..9738148
--- /dev/null
+++ b/gss/src/gr/ebs/gss/client/rest/resource/UserResource.java
@@ -0,0 +1,313 @@
+/*
+ * Copyright 2009 Electronic Business Systems Ltd.
+ *
+ * This file is part of GSS.
+ *
+ * GSS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GSS.  If not, see .
+ */
+package gr.ebs.gss.client.rest.resource;
+
+import java.util.Date;
+
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+
+/**
+ * @author kman
+ */
+public class UserResource extends RestResource {
+
+	/**
+	 * @param path
+	 */
+	public UserResource(String path) {
+		super(path);
+	}
+
+	private String name;
+
+	private String username;
+
+	private String email;
+
+	private Date creationDate;
+
+	private Date modificationDate;
+
+	private String filesPath;
+
+	private String trashPath;
+
+	private String sharedPath;
+
+	private String othersPath;
+
+	private String tagsPath;
+
+	private String groupsPath;
+
+	private QuotaHolder quota;
+
+	/**
+	 * Retrieve the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Modify the name.
+	 *
+	 * @param name the name to set
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Retrieve the username.
+	 *
+	 * @return the username
+	 */
+	public String getUsername() {
+		return username;
+	}
+
+	/**
+	 * Modify the username.
+	 *
+	 * @param username the username to set
+	 */
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	/**
+	 * Retrieve the email.
+	 *
+	 * @return the email
+	 */
+	public String getEmail() {
+		return email;
+	}
+
+	/**
+	 * Modify the email.
+	 *
+	 * @param email the email to set
+	 */
+	public void setEmail(String email) {
+		this.email = email;
+	}
+
+	/**
+	 * Retrieve the creationDate.
+	 *
+	 * @return the creationDate
+	 */
+	public Date getCreationDate() {
+		return creationDate;
+	}
+
+	/**
+	 * Modify the creationDate.
+	 *
+	 * @param creationDate the creationDate to set
+	 */
+	public void setCreationDate(Date creationDate) {
+		this.creationDate = creationDate;
+	}
+
+	/**
+	 * Retrieve the modificationDate.
+	 *
+	 * @return the modificationDate
+	 */
+	public Date getModificationDate() {
+		return modificationDate;
+	}
+
+	/**
+	 * Modify the modificationDate.
+	 *
+	 * @param modificationDate the modificationDate to set
+	 */
+	public void setModificationDate(Date modificationDate) {
+		this.modificationDate = modificationDate;
+	}
+
+	/**
+	 * Retrieve the filesPath.
+	 *
+	 * @return the filesPath
+	 */
+	public String getFilesPath() {
+		return filesPath;
+	}
+
+	/**
+	 * Modify the filesPath.
+	 *
+	 * @param filesPath the filesPath to set
+	 */
+	public void setFilesPath(String filesPath) {
+		this.filesPath = filesPath;
+	}
+
+	/**
+	 * Retrieve the trashPath.
+	 *
+	 * @return the trashPath
+	 */
+	public String getTrashPath() {
+		return trashPath;
+	}
+
+	/**
+	 * Modify the trashPath.
+	 *
+	 * @param trashPath the trashPath to set
+	 */
+	public void setTrashPath(String trashPath) {
+		this.trashPath = trashPath;
+	}
+
+	/**
+	 * Retrieve the sharedPath.
+	 *
+	 * @return the sharedPath
+	 */
+	public String getSharedPath() {
+		return sharedPath;
+	}
+
+	/**
+	 * Modify the sharedPath.
+	 *
+	 * @param sharedPath the sharedPath to set
+	 */
+	public void setSharedPath(String sharedPath) {
+		this.sharedPath = sharedPath;
+	}
+
+	/**
+	 * Retrieve the othersPath.
+	 *
+	 * @return the othersPath
+	 */
+	public String getOthersPath() {
+		return othersPath;
+	}
+
+	/**
+	 * Modify the othersPath.
+	 *
+	 * @param othersPath the othersPath to set
+	 */
+	public void setOthersPath(String othersPath) {
+		this.othersPath = othersPath;
+	}
+
+	/**
+	 * Retrieve the tagsPath.
+	 *
+	 * @return the tagsPath
+	 */
+	public String getTagsPath() {
+		return tagsPath;
+	}
+
+	/**
+	 * Modify the tagsPath.
+	 *
+	 * @param tagsPath the tagsPath to set
+	 */
+	public void setTagsPath(String tagsPath) {
+		this.tagsPath = tagsPath;
+	}
+
+	/**
+	 * Retrieve the groupsPath.
+	 *
+	 * @return the groupsPath
+	 */
+	public String getGroupsPath() {
+		return groupsPath;
+	}
+
+	/**
+	 * Modify the groupsPath.
+	 *
+	 * @param groupsPath the groupsPath to set
+	 */
+	public void setGroupsPath(String groupsPath) {
+		this.groupsPath = groupsPath;
+	}
+
+	/**
+	 * Retrieve the quota.
+	 *
+	 * @return the quota
+	 */
+	public QuotaHolder getQuota() {
+		return quota;
+	}
+
+	/**
+	 * Modify the quota.
+	 *
+	 * @param quota the quota to set
+	 */
+	public void setQuota(QuotaHolder quota) {
+		this.quota = quota;
+	}
+
+	public void createFromJSON(String text) {
+		JSONObject json = (JSONObject) JSONParser.parse(text);
+		email = unmarshallString(json, "email");
+		name = unmarshallString(json, "name");
+		username = unmarshallString(json, "username");
+		filesPath = unmarshallString(json, "files");
+		groupsPath = unmarshallString(json, "groups");
+		othersPath = unmarshallString(json, "others");
+		sharedPath = unmarshallString(json, "shared");
+		tagsPath = unmarshallString(json, "tags");
+		trashPath = unmarshallString(json, "trash");
+		if (json.get("creationDate") != null)
+			creationDate = new Date(new Long(json.get("creationDate").toString()));
+		if (json.get("modificationDate") != null)
+			modificationDate = new Date(new Long(json.get("modificationDate").toString()));
+		if (json.get("quota") != null) {
+			JSONObject qj = (JSONObject) json.get("quota");
+			if (qj != null) {
+				quota = new QuotaHolder();
+				if(qj.get("totalFiles") != null)
+					quota.setFileCount(new Long(qj.get("totalFiles").toString()));
+				if(qj.get("totalBytes") != null)
+					quota.setFileSize(new Long(qj.get("totalBytes").toString()));
+				if(qj.get("bytesRemaining") != null)
+					quota.setQuotaLeftSize(new Long(qj.get("bytesRemaining").toString()));
+			}
+		}
+
+	}
+
+	public String toString() {
+		String res = email + "\n" + name + "\n" + username + "\n" + filesPath + "\n" + groupsPath;
+		return res;
+	}
+
+}
diff --git a/gss/src/gr/ebs/gss/client/tree/FolderSubtree.java b/gss/src/gr/ebs/gss/client/tree/FolderSubtree.java
index d2d727b..a4224a9 100644
--- a/gss/src/gr/ebs/gss/client/tree/FolderSubtree.java
+++ b/gss/src/gr/ebs/gss/client/tree/FolderSubtree.java
@@ -19,20 +19,19 @@
 package gr.ebs.gss.client.tree;
 
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.GSSServiceAsync;
 import gr.ebs.gss.client.PopupTree;
 import gr.ebs.gss.client.Folders.Images;
 import gr.ebs.gss.client.dnd.DnDTreeItem;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteGet;
+import gr.ebs.gss.client.rest.ExecuteMultipleGet;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.UserResource;
 
 import java.util.List;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.IncrementalCommand;
-import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.TreeItem;
 
 /**
@@ -62,100 +61,139 @@ public class FolderSubtree extends Subtree {
 	 * @return
 	 */
 	public boolean fetchRootFolder() {
-		UserDTO user = GSS.get().getCurrentUser();
-		if (user == null)
+
+		UserResource userResource = GSS.get().getCurrentUserResource();
+		if (userResource == null)
 			return !DONE;
-		final Long userId = user.getId();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		service.getRootFolder(userId, new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				final FolderDTO rootFolder = (FolderDTO) result;
-				GWT.log("got folder '" + rootFolder.getName() + "'", null);
-				rootItem = new DnDTreeItem(imageItemHTML(images.home(), rootFolder.getName()), rootFolder.getName(), false);
-				rootItem.setUserObject(rootFolder);
+
+		final String path = userResource.getFilesPath();
+		ExecuteGet gf = new ExecuteGet(FolderResource.class, path) {
+
+			public void onComplete() {
+				FolderResource rootResource = getResult();
+				rootItem = new DnDTreeItem(imageItemHTML(images.home(), rootResource.getName()), rootResource.getName(), false);
+				rootItem.setUserObject(rootResource);
+				tree.clear();
 				tree.addItem(rootItem);
 				rootItem.doDroppable();
-				//updateSubFolders(rootItem, rootFolder.getSubfolders(), rootFolder, images.folderYellow());
-				updateSubFoldersLazily(rootItem, rootFolder.getSubfolders(), images.folderYellow());
+				//hack for lazy loading
+				/*for(String s : rootResource.getSubfolderPaths()){
+					if(!s.endsWith("/"))
+						s=s+"/";
+					String[] pathElements =  s.split("/");
+					FolderResource tr = new FolderResource(s);
+					tr.setName(pathElements[pathElements.length-1]);
+					DnDTreeItem child = (DnDTreeItem) addImageItem(rootItem, URL.decode(tr.getName()), images.folderYellow(), true);
+					child.doDraggable();
+					child.setUserObject(tr);
+					child.setState(false);
+				}*/
+				//for(FolderResource r : rootResource.get)
+				updateSubFoldersLazily(rootItem, rootResource.getFolders(), images.folderYellow());
 				rootItem.setState(true);
-
+				//updateSubfolders(rootItem, true);
 			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
+			public void onError(Throwable t) {
+				GWT.log("Error fetching root folder", t);
+				GSS.get().displayError("Unable to fetch root folder");
+				if(rootItem != null){
+					rootItem = new DnDTreeItem(imageItemHTML(images.home(), "ERROR"), "ERROR", false);
+					tree.clear();
+					tree.addItem(rootItem);
+				}
 			}
-		});
+
+		};
+		DeferredCommand.addCommand(gf);
+
 		return DONE;
 	}
 
-	public void updateSubfolders(final Long userId, final TreeItem folderItem) {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		if (!(folderItem.getUserObject() instanceof FolderDTO))
-			return;
-		final FolderDTO f = (FolderDTO) folderItem.getUserObject();
-		final Long folderId = f.getId();
-		service.getSubfolders(userId, folderId, new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				final List subfolders = (List) result;
-				//updateSubFolders(folderItem, subfolders, images.folderYellow());
-				updateSubFoldersLazily((DnDTreeItem) folderItem,  subfolders, images.folderYellow());
-				GSS.get().hideLoadingIndicator();
-			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-			}
-		});
+
+	public void updateSubfolders(final DnDTreeItem folderItem) {
+		if (folderItem.getFolderResource() == null) {
+			GWT.log("folder resource is null", null);
+			return;
+		}
+		updateNodes(folderItem, folderItem);
 
 	}
 
-	public void updateFolderAndSubfolders(final Long userId, final TreeItem folderItem) {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		if (!(folderItem.getUserObject() instanceof FolderDTO))
-			return;
-		final FolderDTO f = (FolderDTO) folderItem.getUserObject();
-		final Long folderId = f.getId();
-		service.getFolderWithSubfolders(userId, folderId, new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				final FolderDTO  folder = (FolderDTO) result;
-				//updateSubFolders(folderItem, subfolders, images.folderYellow());
-				updateFolderAndSubFoldersLazily((DnDTreeItem) folderItem, folder, folder.getSubfolders(), images.folderYellow());
-				GSS.get().hideLoadingIndicator();
+	private void updateNodes(final DnDTreeItem folderItem, final DnDTreeItem initialParent) {
+		String parentName = "";
+		if (folderItem.getParentItem() != null)
+			parentName = ((DnDTreeItem) folderItem.getParentItem()).getFolderResource().getName() + "->";
+		parentName = parentName + folderItem.getFolderResource().getName();
+		final boolean firstRun = getRootItem().getChildCount() == 0;
+		ExecuteMultipleGet gf = new ExecuteMultipleGet(FolderResource.class, folderItem	.getFolderResource()
+																														.getSubfolderPaths()
+																														.toArray(new String[] {})) {
+			public void onComplete() {
+				List res = getResult();
+				/*folderItem.removeItems();
+				if (folderItem.equals(getRootItem()))
+					getRootItem().setState(true);
+
+				for (FolderResource r : res) {
+
+					DnDTreeItem child = (DnDTreeItem) addImageItem(folderItem, r.getName(), images.folderYellow(), true);
+					child.doDraggable();
+					child.setUserObject(r);
+					child.setState(false);
+				}*/
+				folderItem.getFolderResource().setFolders(res);
+				updateSubFoldersLazily(folderItem, res, images.folderYellow());
+				for (int i = 0; i < folderItem.getChildCount(); i++) {
+					DnDTreeItem anItem = (DnDTreeItem) folderItem.getChild(i);
+
+					//if(anItem.getParentItem().equals(initialParent))
+						//updateNodes(anItem, initialParent);
+					//else
+						updateSubFoldersLazily(anItem, anItem.getFolderResource().getFolders(), images.folderYellow());
+						anItem.setState(false);
+				}
 			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
+			public void onError(Throwable t) {
+				GSS.get().displayError("Unable to fetch subfolders");
+				GWT.log("Unable to fetch subfolders", t);
 			}
-		});
+
+			@Override
+			public void onError(String p, Throwable throwable) {
+				GWT.log("Path:"+p, throwable);
+			}
+
+
+		};
+		DeferredCommand.addCommand(gf);
 
 	}
 
-	public void updateNode(TreeItem node, FolderDTO folder) {
-		node.getWidget().removeStyleName("gss-SelectedRow");
-		if(node instanceof DnDTreeItem){
-			((DnDTreeItem) node).undoDraggable();
-			((DnDTreeItem) node).updateWidget(imageItemHTML(images.folderYellow(),folder.getName()));
-			((DnDTreeItem) node).doDraggable();
-		}
-		else
-			node.setWidget(imageItemHTML(images.folderYellow(),folder.getName()));
-		node.setUserObject(folder);
+	public void updateFolderAndSubfolders(final DnDTreeItem folderItem) {
+		final String path = folderItem.getFolderResource().getPath();
+		ExecuteGet gf = new ExecuteGet(FolderResource.class, path) {
+
+			public void onComplete() {
+				FolderResource rootResource = getResult();
+				if (!folderItem.equals(rootItem)) {
+					folderItem.undoDraggable();
+					folderItem.updateWidget(imageItemHTML(images.folderYellow(), rootResource.getName()));
+					folderItem.setUserObject(rootResource);
+					folderItem.doDraggable();
+				} else
+					folderItem.setUserObject(rootResource);
+				updateSubfolders(folderItem);
+			}
 
+			public void onError(Throwable t) {
+				GWT.log("Error fetching folder", t);
+				GSS.get().displayError("Unable to fetch folder:" + folderItem.getFolderResource().getName());
+			}
+		};
+		DeferredCommand.addCommand(gf);
 
 	}
 
@@ -168,4 +206,6 @@ public class FolderSubtree extends Subtree {
 		return rootItem;
 	}
 
+
+
 }
diff --git a/gss/src/gr/ebs/gss/client/tree/MyShareSubtree.java b/gss/src/gr/ebs/gss/client/tree/MyShareSubtree.java
index fb6c277..8090115 100644
--- a/gss/src/gr/ebs/gss/client/tree/MyShareSubtree.java
+++ b/gss/src/gr/ebs/gss/client/tree/MyShareSubtree.java
@@ -19,22 +19,22 @@
 package gr.ebs.gss.client.tree;
 
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.GSSServiceAsync;
 import gr.ebs.gss.client.PopupTree;
 import gr.ebs.gss.client.Folders.Images;
 import gr.ebs.gss.client.dnd.DnDTreeItem;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteGet;
+import gr.ebs.gss.client.rest.ExecuteMultipleGet;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.SharedResource;
+import gr.ebs.gss.client.rest.resource.UserResource;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.IncrementalCommand;
-import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.TreeItem;
-
 /**
  * @author kman
  */
@@ -47,9 +47,8 @@ public class MyShareSubtree extends Subtree {
 
 	private DnDTreeItem rootItem;
 
-
 	public MyShareSubtree(PopupTree tree, final Images _images) {
-		super(tree,_images);
+		super(tree, _images);
 
 		DeferredCommand.addCommand(new IncrementalCommand() {
 
@@ -60,114 +59,187 @@ public class MyShareSubtree extends Subtree {
 	}
 
 	public boolean updateInit() {
-		UserDTO user = GSS.get().getCurrentUser();
-		if (user == null || GSS.get().getFolders().getRootItem() == null || GSS.get().getFolders().getTrashItem() == null)
+		UserResource userResource = GSS.get().getCurrentUserResource();
+		if (userResource == null || GSS.get().getFolders().getRootItem() == null || GSS.get().getFolders().getTrashItem() == null)
 			return !DONE;
-		final Long userId = user.getId();
 
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		service.getSharedRootFolders(userId, new AsyncCallback() {
+		ExecuteGet gs = new ExecuteGet(SharedResource.class, userResource.getSharedPath()) {
 
-			public void onSuccess(final Object result) {
-				final List subfolders = (List) result;
-				rootItem = new DnDTreeItem(imageItemHTML(images.myShared(), "My Shared"),"My Shared", false);
-				rootItem.setUserObject("My shared");
+			public void onComplete() {
+				rootItem = new DnDTreeItem(imageItemHTML(images.myShared(), "My Shared"), "My Shared", false);
+				rootItem.setUserObject(getResult());
 				tree.addItem(rootItem);
 				rootItem.removeItems();
-				updateSubFoldersLazily(rootItem, subfolders, images.sharedFolder());
-				GSS.get().hideLoadingIndicator();
+				rootItem.doDroppable();
+				update(rootItem);
 			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
+			public void onError(Throwable t) {
+				GWT.log("Error fetching Shared Root folder", t);
+				GSS.get().displayError("Unable to fetch Shared Root folder");
+				if(rootItem != null){
+					rootItem = new DnDTreeItem(imageItemHTML(images.myShared(), "ERROR"), "ERROR", false);
+					tree.addItem(rootItem);
+				}
 			}
-		});
+		};
+		DeferredCommand.addCommand(gs);
 		return DONE;
 
 	}
 
-	public void update(final TreeItem folderItem) {
+	public void update(final DnDTreeItem folderItem) {
+		if (folderItem.getFolderResource() != null) {
+			folderItem.removeItems();
+			List newPaths = new ArrayList();
+			for (String s : folderItem.getFolderResource().getSubfolderPaths()) {
 
-		UserDTO user = GSS.get().getCurrentUser();
-		Long userId = user.getId();
-		if (GSS.get().getFolders().isMyShares(folderItem)) {
-			GSS.get().showLoadingIndicator();
-			final GSSServiceAsync service = GSS.get().getRemoteService();
-			service.getSharedRootFolders(userId, new AsyncCallback() {
+				if (!s.endsWith("/"))
+					s = s + "/";
+				if (rootItem.getSharedResource().getSubfolderPaths().contains(s))
+					newPaths.add(s);
+			}
+			String parentName = "";
+			if(folderItem.getParentItem() != null && ((DnDTreeItem)folderItem.getParentItem()).getFolderResource() != null)
+				parentName = ((DnDTreeItem)folderItem.getParentItem()).getFolderResource().getName()+"->";
+			parentName = parentName+folderItem.getFolderResource().getName();
+			folderItem.getFolderResource().setSubfolderPaths(newPaths);
+			ExecuteMultipleGet gf = new ExecuteMultipleGet(FolderResource.class, newPaths.toArray(new String[] {})) {
 
-				public void onSuccess(final Object result) {
-					final List subfolders = (List) result;
-					rootItem.removeItems();
-					updateSubFoldersLazily(rootItem, subfolders, images.sharedFolder());
-					GSS.get().hideLoadingIndicator();
+				public void onComplete() {
+					List res = getResult();
+					for (FolderResource r : res) {
+
+						DnDTreeItem child = (DnDTreeItem) addImageItem(folderItem, r.getName(), images.folderYellow(), true);
+						child.setUserObject(r);
+						child.setState(false);
+						child.doDraggable();
+					}
+
+				}
+
+				public void onError(Throwable t) {
+					GSS.get().displayError("Unable to fetch subfolders");
+					GWT.log("Unable to fetch subfolders", t);
 				}
 
-				public void onFailure(final Throwable caught) {
-					GWT.log("", caught);
-					GSS.get().hideLoadingIndicator();
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-					else
-						GSS.get().displayError(caught.getMessage());
+				@Override
+				public void onError(String p, Throwable throwable) {
+					GWT.log("Path:"+p, throwable);
 				}
-			});
+			};
+			DeferredCommand.addCommand(gf);
 		}
-		else if (GSS.get().getFolders().isMySharedItem(folderItem)) {
-			final FolderDTO f = (FolderDTO) folderItem.getUserObject();
-			final Long folderId = f.getId();
-			GSS.get().showLoadingIndicator();
-			final GSSServiceAsync service = GSS.get().getRemoteService();
-			service.getSharedSubfolders(userId, folderId, new AsyncCallback() {
-
-				public void onSuccess(final Object result) {
-					final List subfolders = (List) result;
-					updateSubFoldersLazily((DnDTreeItem) folderItem, subfolders, images.sharedFolder());
-					GSS.get().hideLoadingIndicator();
+		if (folderItem.getSharedResource() != null) {
+			folderItem.removeItems();
+			List paths = folderItem.getSharedResource().getSubfolderPaths();
+			List newPaths = new ArrayList();
+			for (String r : paths)
+				if (isRoot(r, paths))
+					newPaths.add(r);
+			ExecuteMultipleGet gf = new ExecuteMultipleGet(FolderResource.class, newPaths.toArray(new String[] {})) {
+
+				public void onComplete() {
+					List res = getResult();
+					for (FolderResource r : res) {
+						DnDTreeItem child = (DnDTreeItem) addImageItem(folderItem, r.getName(), images.folderYellow(), true);
+						child.setUserObject(r);
+						child.setState(false);
+						child.doDraggable();
+					}
+
 				}
 
-				public void onFailure(final Throwable caught) {
-					GWT.log("", caught);
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-					else
-						GSS.get().displayError(caught.getMessage());
+				public void onError(Throwable t) {
+					GSS.get().displayError("Unable to fetch subfolders");
+					GWT.log("Unable to fetch subfolders", t);
 				}
-			});
+
+				@Override
+				public void onError(String p, Throwable throwable) {
+					GWT.log("Path:"+p, throwable);
+				}
+			};
+			DeferredCommand.addCommand(gf);
 		}
+	}
+
+	private void handleFolders(DnDTreeItem child, FolderResource ff, List folders) {
 
 	}
 
-	public void updateFolderAndSubfolders(final Long userId, final TreeItem folderItem) {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		if (!(folderItem.getUserObject() instanceof FolderDTO))
-			return;
-		final FolderDTO f = (FolderDTO) folderItem.getUserObject();
-		final Long folderId = f.getId();
-		service.getFolderWithSubfolders(userId, folderId, new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				final FolderDTO  folder = (FolderDTO) result;
-				//updateSubFolders(folderItem, subfolders, images.folderYellow());
-				updateFolderAndSubFoldersLazily((DnDTreeItem) folderItem, folder, folder.getSubfolders(), images.sharedFolder());
-				GSS.get().hideLoadingIndicator();
-			}
+	private boolean isRoot(FolderResource f, List folders) {
+		for (FolderResource t : folders)
+			if (!f.getPath().equals(t.getPath()) && f.getPath().startsWith(t.getPath()))
+				return false;
+		return true;
+	}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-			}
-		});
+	private boolean isRoot(String f, List folders) {
+		for (String t : folders)
+			if (!f.equals(t) && f.startsWith(t))
+				return false;
+		return true;
+	}
+
+
+
+	public void updateFolderAndSubfolders(final DnDTreeItem folderItem) {
+		if (folderItem.getFolderResource() != null) {
+			final String path = folderItem.getFolderResource().getPath();
+			ExecuteGet gs = new ExecuteGet(SharedResource.class, GSS.get().getCurrentUserResource().getSharedPath()) {
+
+				public void onComplete() {
+					rootItem.setUserObject(getResult());
+					ExecuteGet gf = new ExecuteGet(FolderResource.class, path) {
+
+						public void onComplete() {
+							FolderResource rootResource = getResult();
+							if(rootItem.getSharedResource().getSubfolderPaths().contains(rootResource.getPath())){
+								folderItem.undoDraggable();
+								folderItem.updateWidget(imageItemHTML(images.folderYellow(), rootResource.getName()));
+								folderItem.setUserObject(rootResource);
+								folderItem.doDraggable();
+								update(folderItem);
+							} else
+								folderItem.getParentItem().removeItem(folderItem);
+						}
+
+						public void onError(Throwable t) {
+							GWT.log("Error fetching folder", t);
+							GSS.get().displayError("Unable to fetch folder:" + folderItem.getFolderResource().getName());
+						}
+					};
+					DeferredCommand.addCommand(gf);
+				}
+
+				public void onError(Throwable t) {
+					GWT.log("Error fetching Shared Root folder", t);
+					GSS.get().displayError("Unable to fetch Shared Root folder");
+				}
+			};
+			DeferredCommand.addCommand(gs);
+
+		}
+		else if( folderItem.getSharedResource() != null){
+			ExecuteGet gs = new ExecuteGet(SharedResource.class, GSS.get().getCurrentUserResource().getSharedPath()) {
+
+				public void onComplete() {
+					rootItem.setUserObject(getResult());
+					rootItem.removeItems();
+					update(rootItem);
+				}
+
+				public void onError(Throwable t) {
+					GWT.log("Error fetching Shared Root folder", t);
+					GSS.get().displayError("Unable to fetch Shared Root folder");
+				}
+			};
+			DeferredCommand.addCommand(gs);
+		}
 
 	}
+
 	/**
 	 * Retrieve the rootItem.
 	 *
@@ -176,32 +248,18 @@ public class MyShareSubtree extends Subtree {
 	public TreeItem getRootItem() {
 		return rootItem;
 	}
-	public boolean isShared(FolderDTO folder){
-		return itemThatContainsFolder(rootItem, folder) !=null;
-	}
-	private  TreeItem itemThatContainsFolder(TreeItem item, FolderDTO folder){
-		if(item == null)
-			return null;
-		if(item.getUserObject() != null && item.getUserObject() instanceof FolderDTO){
-			FolderDTO f = (FolderDTO)item.getUserObject();
-			if(f.getId().equals(folder.getId())) return item;
-		}
-		for(int i=0; i.
  */
+
 package gr.ebs.gss.client.tree;
 
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.GSSServiceAsync;
 import gr.ebs.gss.client.PopupTree;
 import gr.ebs.gss.client.Folders.Images;
 import gr.ebs.gss.client.dnd.DnDTreeItem;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteGet;
+import gr.ebs.gss.client.rest.ExecuteMultipleGet;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.OtherUserResource;
+import gr.ebs.gss.client.rest.resource.OthersResource;
+import gr.ebs.gss.client.rest.resource.UserResource;
 
 import java.util.List;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.IncrementalCommand;
-import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.TreeItem;
 
 /**
@@ -59,177 +61,147 @@ public class OthersSharesSubtree extends Subtree {
 	}
 
 	public boolean updateInit() {
-		UserDTO user = GSS.get().getCurrentUser();
-		if (user == null || GSS.get().getFolders().getRootItem() == null || GSS.get().getFolders().getTrashItem() == null || GSS.get()
-																																.getFolders()
-																																.getMySharesItem() == null)
+		UserResource userResource = GSS.get().getCurrentUserResource();
+		if (userResource == null || GSS.get().getFolders().getRootItem() == null || GSS.get().getFolders().getTrashItem() == null || GSS.get()
+																																		.getFolders()
+																																		.getMySharesItem() == null)
 			return !DONE;
-		Long userId = user.getId();
 
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		service.getUsersSharingFoldersForUser(userId, new AsyncCallback() {
+		ExecuteGet go = new ExecuteGet(OthersResource.class, userResource.getOthersPath()) {
 
-			public void onSuccess(final Object result) {
-				final List subfolders = (List) result;
-				GWT.log("sub:" + subfolders.size(), null);
+			public void onComplete() {
 				rootItem = new DnDTreeItem(imageItemHTML(images.othersShared(), "Other's Shared"), "Other's Shared", false);
-				rootItem.setUserObject("Shared");
+				rootItem.setUserObject(getResult());
 				tree.addItem(rootItem);
 				rootItem.removeItems();
-
-				for (int i = 0; i < subfolders.size(); i++) {
-
-					final UserDTO subfolder = subfolders.get(i);
-
-					final TreeItem item = addImageItem(rootItem, subfolder.getUsername(), images.folderYellow(), false);
-					item.setUserObject(subfolder);
-
-				}
-				GSS.get().hideLoadingIndicator();
+				update(rootItem);
 				GSS.get().removeGlassPanel();
+
 			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
+			public void onError(Throwable t) {
+				GWT.log("Error fetching Others Root folder", t);
+				GSS.get().displayError("Unable to fetch Others Root folder");
+				if(rootItem != null){
+					rootItem = new DnDTreeItem(imageItemHTML(images.othersShared(), "ERROR"), "ERROR", false);
+					tree.addItem(rootItem);
+				}
 			}
-		});
+		};
+		DeferredCommand.addCommand(go);
 		return DONE;
 
 	}
 
-	public void update(final TreeItem folderItem) {
-
-		UserDTO user = GSS.get().getCurrentUser();
-		final Long userId = user.getId();
-		if (GSS.get().getFolders().isOthersShared(folderItem)) {
-			GSS.get().showLoadingIndicator();
-			final GSSServiceAsync service = GSS.get().getRemoteService();
-			service.getUsersSharingFoldersForUser(userId, new AsyncCallback() {
-
-				public void onSuccess(final Object result) {
-					final List subfolders = (List) result;
-					GWT.log("sub:" + subfolders.size(), null);
-					rootItem.removeItems();
-					for (int i = 0; i < subfolders.size(); i++) {
-						final UserDTO subfolder = subfolders.get(i);
-						final TreeItem item = addImageItem(rootItem, subfolder.getUsername(), images.folderYellow(), false);
-						item.setUserObject(subfolder);
-						doJob(item, userId, subfolder);
+	public void update(final DnDTreeItem folderItem) {
+		UserResource userResource = GSS.get().getCurrentUserResource();
+		if (folderItem.getOthersResource() != null) {
+
+			ExecuteMultipleGet go = new ExecuteMultipleGet(OtherUserResource.class, folderItem.getOthersResource()
+																																	.getOthers()
+																																	.toArray(new String[] {})) {
+
+				public void onComplete() {
+					List res = getResult();
+					folderItem.removeItems();
+					for (OtherUserResource r : res) {
+						DnDTreeItem child = (DnDTreeItem) addImageItem(folderItem, r.getName(), images.folderYellow(), true);
+						child.setUserObject(r);
+						child.setState(false);
 					}
-					// mySharesItem.setState(true);
-					GSS.get().hideLoadingIndicator();
 				}
 
-				public void onFailure(final Throwable caught) {
-					GWT.log("", caught);
-					GSS.get().hideLoadingIndicator();
-					if (caught instanceof RpcException)
-						GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-					else
-						GSS.get().displayError(caught.getMessage());
+				public void onError(Throwable t) {
+					GWT.log("Error fetching Others Root folder", t);
+					GSS.get().displayError("Unable to fetch Others Root folder");
 				}
-			});
-		} else if (GSS.get().getFolders().isOthersSharedItem(folderItem))
-			if (folderItem.getUserObject() instanceof UserDTO) {
-
-				final UserDTO ownerDTO = (UserDTO) folderItem.getUserObject();
-				GSS.get().showLoadingIndicator();
-				final GSSServiceAsync service = GSS.get().getRemoteService();
-				service.getSharedRootFolders(ownerDTO.getId(), userId, new AsyncCallback() {
-
-					public void onSuccess(final Object result) {
-						final List subfolders = (List) result;
-						GWT.log("sub:" + subfolders.size(), null);
-						updateSubFoldersLazily((DnDTreeItem) folderItem, subfolders, images.folderYellow());
-						GSS.get().hideLoadingIndicator();
-					}
 
-					public void onFailure(final Throwable caught) {
-						GWT.log("", caught);
-						GSS.get().hideLoadingIndicator();
-						if (caught instanceof RpcException)
-							GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-						else
-							GSS.get().displayError(caught.getMessage());
-					}
-				});
-			} else if (folderItem.getUserObject() instanceof FolderDTO) {
-				final FolderDTO f = (FolderDTO) folderItem.getUserObject();
-				final Long folderId = f.getId();
-				GSS.get().showLoadingIndicator();
-				final GSSServiceAsync service = GSS.get().getRemoteService();
-				service.getSharedSubfolders(f.getOwner().getId(), userId, folderId, new AsyncCallback() {
-
-					public void onSuccess(final Object result) {
-						final List subfolders = (List) result;
-						updateSubFoldersLazily((DnDTreeItem) folderItem, subfolders, images.folderYellow());
-						GSS.get().hideLoadingIndicator();
-					}
-
-					public void onFailure(final Throwable caught) {
-						GWT.log("", caught);
-						if (caught instanceof RpcException)
-							GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-						else
-							GSS.get().displayError(caught.getMessage());
+				@Override
+				public void onError(String p, Throwable throwable) {
+					GWT.log("Path:"+p, throwable);
+				}
+			};
+			DeferredCommand.addCommand(go);
+		} else if (folderItem.getOtherUserResource() != null) {
+
+			ExecuteMultipleGet go = new ExecuteMultipleGet(FolderResource.class, folderItem	.getOtherUserResource()
+																															.getSubfolderPaths()
+																															.toArray(new String[] {})) {
+
+				public void onComplete() {
+					List res = getResult();
+					folderItem.removeItems();
+					debug();
+					for (FolderResource r : res) {
+						DnDTreeItem child = (DnDTreeItem) addImageItem(folderItem, r.getName(), images.folderYellow(), true);
+						child.setUserObject(r);
+						child.setState(false);
 					}
-				});
+				}
 
-			}
+				public void onError(Throwable t) {
+					GWT.log("Error fetching Others Root folder", t);
+					GSS.get().displayError("Unable to fetch Others Root folder");
+				}
 
-	}
+				@Override
+				public void onError(String p, Throwable throwable) {
+					GWT.log("Path:"+p, throwable);
+				}
+			};
+			DeferredCommand.addCommand(go);
+		} else if (folderItem.getFolderResource() != null) {
+
+			ExecuteMultipleGet go = new ExecuteMultipleGet(FolderResource.class, folderItem	.getFolderResource()
+																															.getSubfolderPaths()
+																															.toArray(new String[] {})) {
+
+				public void onComplete() {
+					List res = getResult();
+					folderItem.removeItems();
+					for (FolderResource r : res) {
+						DnDTreeItem child = (DnDTreeItem) addImageItem(folderItem, r.getName(), images.folderYellow(), true);
+						child.setUserObject(r);
+						child.setState(false);
+					}
+				}
 
-	public void updateFolderAndSubfolders(final Long userId, final TreeItem folderItem) {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		if (!(folderItem.getUserObject() instanceof FolderDTO))
-			return;
-		final FolderDTO f = (FolderDTO) folderItem.getUserObject();
-		final Long folderId = f.getId();
-		service.getFolderWithSubfolders(f.getOwner().getId(), userId, folderId, new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				final FolderDTO  folder = (FolderDTO) result;
-				//updateSubFolders(folderItem, subfolders, images.folderYellow());
-				updateFolderAndSubFoldersLazily((DnDTreeItem) folderItem, folder, folder.getSubfolders(), images.folderYellow());
-				GSS.get().hideLoadingIndicator();
-			}
+				public void onError(Throwable t) {
+					GWT.log("Error fetching Others Root folder", t);
+					GSS.get().displayError("Unable to fetch Others Root folder");
+				}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-			}
-		});
+				@Override
+				public void onError(String p, Throwable throwable) {
+					GWT.log("Path:"+p, throwable);
+				}
+			};
+			DeferredCommand.addCommand(go);
+		}
 
 	}
 
-	private void doJob(final TreeItem folderItem, Long userId, UserDTO ownerDTO) {
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		service.getSharedRootFolders(ownerDTO.getId(), userId, new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				final List subfolders = (List) result;
-				updateSubFoldersLazily((DnDTreeItem) folderItem, subfolders, images.folderYellow());
-				GSS.get().hideLoadingIndicator();
-			}
+	public void updateFolderAndSubfolders(final DnDTreeItem folderItem) {
+		if (folderItem.getFolderResource() != null) {
+			final String path = folderItem.getFolderResource().getPath();
+			ExecuteGet gf = new ExecuteGet(FolderResource.class, path) {
+
+				public void onComplete() {
+					FolderResource rootResource = getResult();
+					folderItem.undoDraggable();
+					folderItem.updateWidget(imageItemHTML(images.folderYellow(), rootResource.getName()));
+					folderItem.setUserObject(rootResource);
+					folderItem.doDraggable();
+					update(folderItem);
+				}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-			}
-		});
+				public void onError(Throwable t) {
+					GWT.log("Error fetching folder", t);
+					GSS.get().displayError("Unable to fetch folder:" + folderItem.getFolderResource().getName());
+				}
+			};
+			DeferredCommand.addCommand(gf);
+		}
 	}
 
 	/**
@@ -241,15 +213,5 @@ public class OthersSharesSubtree extends Subtree {
 		return rootItem;
 	}
 
-	public void updateNode(TreeItem node, FolderDTO folder) {
-		node.getWidget().removeStyleName("gss-SelectedRow");
-		if (node instanceof DnDTreeItem){
-			((DnDTreeItem) node).undoDraggable();
-			((DnDTreeItem) node).updateWidget(imageItemHTML(images.folderYellow(), folder.getName()));
-			((DnDTreeItem) node).doDraggable();
-		}
-		else
-			node.setWidget(imageItemHTML(images.folderYellow(), folder.getName()));
-		node.setUserObject(folder);
-	}
+
 }
diff --git a/gss/src/gr/ebs/gss/client/tree/Subtree.java b/gss/src/gr/ebs/gss/client/tree/Subtree.java
index 6c7fdf6..16ab075 100644
--- a/gss/src/gr/ebs/gss/client/tree/Subtree.java
+++ b/gss/src/gr/ebs/gss/client/tree/Subtree.java
@@ -18,12 +18,10 @@
  */
 package gr.ebs.gss.client.tree;
 
-import gr.ebs.gss.client.GSS;
 import gr.ebs.gss.client.PopupTree;
 import gr.ebs.gss.client.Folders.Images;
 import gr.ebs.gss.client.dnd.DnDTreeItem;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.UserDTO;
+import gr.ebs.gss.client.rest.resource.FolderResource;
 
 import java.util.LinkedList;
 import java.util.List;
@@ -76,90 +74,43 @@ public abstract class Subtree {
 		return html;
 	}
 
-	public void updateSubFoldersLazily(DnDTreeItem folderItem, List subfolders, AbstractImagePrototype image) {
-		for(int i=0; i< folderItem.getChildCount(); i++){
+	public void updateSubFoldersLazily(DnDTreeItem folderItem, List subfolders, AbstractImagePrototype image) {
+		for (int i = 0; i < folderItem.getChildCount(); i++) {
 			DnDTreeItem c = (DnDTreeItem) folderItem.getChild(i);
-			FolderDTO f = (FolderDTO) c.getUserObject();
-			if(!listContainsFolder(f, subfolders)){
+			FolderResource f = (FolderResource) c.getUserObject();
+			if (!listContainsFolder(f, subfolders)) {
 				c.undoDraggable();
 				folderItem.removeItem(c);
 			}
 		}
 
 		LinkedList itemList = new LinkedList();
-		for (FolderDTO subfolder : subfolders) {
+		for (FolderResource subfolder : subfolders) {
 			DnDTreeItem item = folderItem.getChild(subfolder);
-			if(item == null)
+			if (item == null)
 				item = (DnDTreeItem) addImageItem(folderItem, subfolder.getName(), image, true);
 			else
-				item.updateWidget(imageItemHTML(image,subfolder.getName()));
+				item.updateWidget(imageItemHTML(image, subfolder.getName()));
 			item.setUserObject(subfolder);
 			itemList.add(item);
 
 		}
-		for(DnDTreeItem it : itemList)
+		for (DnDTreeItem it : itemList)
 			it.remove();
-		for(DnDTreeItem it : itemList)
+		for (DnDTreeItem it : itemList)
 			folderItem.addItem(it);
-		for(int i=0; i< folderItem.getChildCount(); i++){
+		for (int i = 0; i < folderItem.getChildCount(); i++) {
 			DnDTreeItem c = (DnDTreeItem) folderItem.getChild(i);
 			c.doDraggable();
-			FolderDTO f = (FolderDTO) c.getUserObject();
-			updateSubFoldersLazily(c, f.getSubfolders(), image);
+			FolderResource f = (FolderResource) c.getUserObject();
 		}
 	}
 
-	public void updateFolderAndSubFoldersLazily(DnDTreeItem folderItem, FolderDTO folder, List subfolders, AbstractImagePrototype image) {
-		folderItem.updateWidget(imageItemHTML(image,folder.getName()));
-		folderItem.setUserObject(folder);
-		//if folder is selected update with latest data
-		if(GSS.get().getCurrentSelection() != null && GSS.get().getCurrentSelection() instanceof FolderDTO){
-			FolderDTO currentSelectedNode = (FolderDTO) GSS.get().getCurrentSelection();
-			if(currentSelectedNode.getId().equals(folder.getId()))
-				GSS.get().setCurrentSelection(folder);
-		}
-		updateSubFoldersLazily(folderItem, subfolders, image);
-	}
-
-	private boolean listContainsFolder(FolderDTO folder, List subfolders){
-		for(FolderDTO f : subfolders)
-			if(f.getId().equals(folder.getId()))
-				return true;
-		return false;
-	}
-
-	public void updateUsersLazily(DnDTreeItem userItem, List users, AbstractImagePrototype image) {
-		for(int i=0; i< userItem.getChildCount(); i++){
-			DnDTreeItem c = (DnDTreeItem) userItem.getChild(i);
-			UserDTO f = (UserDTO) c.getUserObject();
-			if(!listContainsUser(f, users)){
-				c.undoDraggable();
-				userItem.removeItem(c);
-			}
-		}
 
-		LinkedList itemList = new LinkedList();
-		for (UserDTO user : users) {
-			DnDTreeItem item = userItem.getChild(user);
-			if(item == null)
-				item = (DnDTreeItem) addImageItem(userItem, user.getName()+"("+user.getUsername()+") files", image, true);
-			else
-				item.updateWidget(imageItemHTML(image,user.getName()+"("+user.getUsername()+") files"));
-			item.setUserObject(user);
-			itemList.add(item);
-
-		}
-		for(DnDTreeItem it : itemList)
-			it.remove();
-		for(DnDTreeItem it : itemList)
-			userItem.addItem(it);
-
-
-	}
 
-	private boolean listContainsUser(UserDTO user, List users){
-		for(UserDTO u : users)
-			if(u.getId().equals(user.getId()))
+	private boolean listContainsFolder(FolderResource folder, List subfolders) {
+		for (FolderResource f : subfolders)
+			if (f.getPath().equals(folder.getPath()))
 				return true;
 		return false;
 	}
diff --git a/gss/src/gr/ebs/gss/client/tree/TrashSubtree.java b/gss/src/gr/ebs/gss/client/tree/TrashSubtree.java
index 4b90b09..1736bd4 100644
--- a/gss/src/gr/ebs/gss/client/tree/TrashSubtree.java
+++ b/gss/src/gr/ebs/gss/client/tree/TrashSubtree.java
@@ -19,40 +19,41 @@
 package gr.ebs.gss.client.tree;
 
 import gr.ebs.gss.client.GSS;
-import gr.ebs.gss.client.GSSServiceAsync;
 import gr.ebs.gss.client.PopupTree;
 import gr.ebs.gss.client.Folders.Images;
 import gr.ebs.gss.client.dnd.DnDTreeItem;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.RpcException;
+import gr.ebs.gss.client.rest.ExecuteGet;
+import gr.ebs.gss.client.rest.RestException;
+import gr.ebs.gss.client.rest.resource.FolderResource;
+import gr.ebs.gss.client.rest.resource.TrashResource;
+import gr.ebs.gss.client.rest.resource.UserResource;
 
 import java.util.List;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.IncrementalCommand;
-import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.TreeItem;
 
 
+
 /**
  * @author kman
- *
  */
-public class TrashSubtree extends Subtree{
+public class TrashSubtree extends Subtree {
+
 	/**
 	 * A constant that denotes the completion of an IncrementalCommand.
 	 */
 	public static final boolean DONE = false;
-	private DnDTreeItem rootItem;
-
 
-	public TrashSubtree(PopupTree tree, final Images _images){
-		super(tree,_images);
+	private DnDTreeItem rootItem;
 
+	public TrashSubtree(PopupTree tree, final Images _images) {
+		super(tree, _images);
 
 		DeferredCommand.addCommand(new IncrementalCommand() {
+
 			public boolean execute() {
 				return updateInit();
 			}
@@ -60,74 +61,67 @@ public class TrashSubtree extends Subtree{
 	}
 
 	public boolean updateInit() {
-		UserDTO user = GSS.get().getCurrentUser();
-		if (user == null || GSS.get().getFolders().getRootItem() == null) return !DONE;
-		Long userId = user.getId();
-
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		service.getDeletedRootFolders(userId, new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				final List subfolders = (List) result;
-				rootItem  = new DnDTreeItem(imageItemHTML(images.trash(), "Trash"),"Trash", false);
-				rootItem.setUserObject("Trash");
-				tree.addItem(rootItem);
-				rootItem.doDroppable();
-				rootItem.removeItems();
-				for (int i = 0; i < subfolders.size(); i++) {
-					final FolderDTO subfolder = subfolders.get(i);
-					final TreeItem item = addImageItem(rootItem, subfolder.getName(), images.folderYellow(), false);
-					item.setUserObject(subfolder);
-				}
-				GSS.get().hideLoadingIndicator();
-			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
-			}
-		});
+		UserResource userResource = GSS.get().getCurrentUserResource();
+		if ( userResource == null || GSS.get().getFolders().getRootItem() == null)
+			return !DONE;
+		update();
 		return DONE;
 
 	}
 
-
-	public boolean update(final TreeItem folderItem) {
-		UserDTO user = GSS.get().getCurrentUser();
-		if (user == null) return !DONE;
-		Long userId = user.getId();
-
-		GSS.get().showLoadingIndicator();
-		final GSSServiceAsync service = GSS.get().getRemoteService();
-		service.getDeletedRootFolders(userId, new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				final List subfolders = (List) result;
+	public void update() {
+		DeferredCommand.addCommand(new ExecuteGet(TrashResource.class, GSS.get().getCurrentUserResource().getTrashPath()) {
+			public void onComplete() {
+				if(rootItem == null){
+					rootItem = new DnDTreeItem(imageItemHTML(images.trash(), "Trash"), "Trash", false);
+					tree.addItem(rootItem);
+					rootItem.doDroppable();
+				}
+				rootItem.setUserObject(getResult());
 				rootItem.removeItems();
-				for (int i = 0; i < subfolders.size(); i++) {
-					final FolderDTO subfolder = subfolders.get(i);
-					final TreeItem item = addImageItem(rootItem, subfolder.getName(), images.folderYellow(), false);
-					item.setUserObject(subfolder);
-
+				List res = rootItem.getTrashResource().getTrashedFolders();
+				for (FolderResource r : res) {
+					DnDTreeItem child = (DnDTreeItem) addImageItem(rootItem, r.getName(), images.folderYellow(), true);
+					child.setUserObject(r);
+					child.setState(false);
 				}
-				GSS.get().hideLoadingIndicator();
 			}
 
-			public void onFailure(final Throwable caught) {
-				GWT.log("", caught);
-				GSS.get().hideLoadingIndicator();
-				if (caught instanceof RpcException)
-					GSS.get().displayError("An error occurred while " + "communicating with the server: " + caught.getMessage());
-				else
-					GSS.get().displayError(caught.getMessage());
+			public void onError(Throwable t) {
+				if(t instanceof RestException){
+					int statusCode = ((RestException)t).getHttpStatusCode();
+					//empty trash ie returns 1223 status code instead of 204
+					if(statusCode == 204 || statusCode == 1223){
+						GWT.log("Trash is empty", null);
+						if(rootItem == null){
+							rootItem = new DnDTreeItem(imageItemHTML(images.trash(), "Trash"), "Trash", false);
+							tree.addItem(rootItem);
+							rootItem.doDroppable();
+						}
+						rootItem.setUserObject(new TrashResource(GSS.get().getCurrentUserResource().getTrashPath()));
+						rootItem.removeItems();
+					} else{
+						if(rootItem == null){
+							rootItem = new DnDTreeItem(imageItemHTML(images.trash(), "Trash"), "Trash", false);
+							tree.addItem(rootItem);
+						}
+						rootItem.setUserObject(new TrashResource(GSS.get().getCurrentUserResource().getTrashPath()));
+						GSS.get().displayError("Unable to fetch trash folder:"+statusCode+" : "+t.getMessage());
+					}
+				}
+				else{
+					GWT.log("", t);
+					GSS.get().displayError("Unable to fetch trash folder:"+t.getMessage());
+					if(rootItem == null){
+						rootItem = new DnDTreeItem(imageItemHTML(images.trash(), "Trash"), "Trash", false);
+						tree.addItem(rootItem);
+						rootItem.doDroppable();
+					}
+					rootItem.setUserObject(new TrashResource(GSS.get().getCurrentUserResource().getTrashPath()));
+				}
 			}
 		});
-		return DONE;
 
 	}
 
diff --git a/gss/src/gr/ebs/gss/public/GSS.html b/gss/src/gr/ebs/gss/public/GSS.html
index b50dc00..f4f7efb 100644
--- a/gss/src/gr/ebs/gss/public/GSS.html
+++ b/gss/src/gr/ebs/gss/public/GSS.html
@@ -28,6 +28,8 @@
 			return false;
 			}
 		
+		
+		
 	
 
 	
diff --git a/gss/src/gr/ebs/gss/public/sha1.js b/gss/src/gr/ebs/gss/public/sha1.js
new file mode 100644
index 0000000..11014f8
--- /dev/null
+++ b/gss/src/gr/ebs/gss/public/sha1.js
@@ -0,0 +1,202 @@
+/*
+ * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
+ * in FIPS PUB 180-1
+ * Version 2.1a Copyright Paul Johnston 2000 - 2002.
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
+ * Distributed under the BSD License
+ * See http://pajhome.org.uk/crypt/md5 for details.
+ */
+
+/*
+ * Configurable variables. You may need to tweak these to be compatible with
+ * the server-side, but the defaults work in most cases.
+ */
+var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
+var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
+var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */
+
+/*
+ * These are the functions you'll usually want to call
+ * They take string arguments and return either hex or base-64 encoded strings
+ */
+function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
+function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
+function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
+function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
+function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
+function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
+
+/*
+ * Perform a simple self-test to see if the VM is working
+ */
+function sha1_vm_test()
+{
+  return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
+}
+
+/*
+ * Calculate the SHA-1 of an array of big-endian words, and a bit length
+ */
+function core_sha1(x, len)
+{
+  /* append padding */
+  x[len >> 5] |= 0x80 << (24 - len % 32);
+  x[((len + 64 >> 9) << 4) + 15] = len;
+
+  var w = Array(80);
+  var a =  1732584193;
+  var b = -271733879;
+  var c = -1732584194;
+  var d =  271733878;
+  var e = -1009589776;
+
+  for(var i = 0; i < x.length; i += 16)
+  {
+    var olda = a;
+    var oldb = b;
+    var oldc = c;
+    var oldd = d;
+    var olde = e;
+
+    for(var j = 0; j < 80; j++)
+    {
+      if(j < 16) w[j] = x[i + j];
+      else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
+      var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
+                       safe_add(safe_add(e, w[j]), sha1_kt(j)));
+      e = d;
+      d = c;
+      c = rol(b, 30);
+      b = a;
+      a = t;
+    }
+
+    a = safe_add(a, olda);
+    b = safe_add(b, oldb);
+    c = safe_add(c, oldc);
+    d = safe_add(d, oldd);
+    e = safe_add(e, olde);
+  }
+  return Array(a, b, c, d, e);
+
+}
+
+/*
+ * Perform the appropriate triplet combination function for the current
+ * iteration
+ */
+function sha1_ft(t, b, c, d)
+{
+  if(t < 20) return (b & c) | ((~b) & d);
+  if(t < 40) return b ^ c ^ d;
+  if(t < 60) return (b & c) | (b & d) | (c & d);
+  return b ^ c ^ d;
+}
+
+/*
+ * Determine the appropriate additive constant for the current iteration
+ */
+function sha1_kt(t)
+{
+  return (t < 20) ?  1518500249 : (t < 40) ?  1859775393 :
+         (t < 60) ? -1894007588 : -899497514;
+}
+
+/*
+ * Calculate the HMAC-SHA1 of a key and some data
+ */
+function core_hmac_sha1(key, data)
+{
+  var bkey = str2binb(key);
+  if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
+
+  var ipad = Array(16), opad = Array(16);
+  for(var i = 0; i < 16; i++)
+  {
+    ipad[i] = bkey[i] ^ 0x36363636;
+    opad[i] = bkey[i] ^ 0x5C5C5C5C;
+  }
+
+  var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
+  return core_sha1(opad.concat(hash), 512 + 160);
+}
+
+/*
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
+ * to work around bugs in some JS interpreters.
+ */
+function safe_add(x, y)
+{
+  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+  return (msw << 16) | (lsw & 0xFFFF);
+}
+
+/*
+ * Bitwise rotate a 32-bit number to the left.
+ */
+function rol(num, cnt)
+{
+  return (num << cnt) | (num >>> (32 - cnt));
+}
+
+/*
+ * Convert an 8-bit or 16-bit string to an array of big-endian words
+ * In 8-bit function, characters >255 have their hi-byte silently ignored.
+ */
+function str2binb(str)
+{
+  var bin = Array();
+  var mask = (1 << chrsz) - 1;
+  for(var i = 0; i < str.length * chrsz; i += chrsz)
+    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
+  return bin;
+}
+
+/*
+ * Convert an array of big-endian words to a string
+ */
+function binb2str(bin)
+{
+  var str = "";
+  var mask = (1 << chrsz) - 1;
+  for(var i = 0; i < bin.length * 32; i += chrsz)
+    str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
+  return str;
+}
+
+/*
+ * Convert an array of big-endian words to a hex string.
+ */
+function binb2hex(binarray)
+{
+  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+  var str = "";
+  for(var i = 0; i < binarray.length * 4; i++)
+  {
+    str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
+           hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8  )) & 0xF);
+  }
+  return str;
+}
+
+/*
+ * Convert an array of big-endian words to a base-64 string
+ */
+function binb2b64(binarray)
+{
+  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+  var str = "";
+  for(var i = 0; i < binarray.length * 4; i += 3)
+  {
+    var triplet = (((binarray[i   >> 2] >> 8 * (3 -  i   %4)) & 0xFF) << 16)
+                | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
+                |  ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
+    for(var j = 0; j < 4; j++)
+    {
+      if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
+      else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
+    }
+  }
+  return str;
+}
diff --git a/gss/src/gr/ebs/gss/server/FileDownload.java b/gss/src/gr/ebs/gss/server/FileDownload.java
deleted file mode 100644
index 409e57f..0000000
--- a/gss/src/gr/ebs/gss/server/FileDownload.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.
- *
- * This file is part of GSS.
- *
- * GSS is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GSS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GSS.  If not, see .
- */
-package gr.ebs.gss.server;
-
-import gr.ebs.gss.client.domain.FileBodyDTO;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.exceptions.InsufficientPermissionsException;
-import gr.ebs.gss.client.exceptions.ObjectNotFoundException;
-import gr.ebs.gss.client.exceptions.RpcException;
-import gr.ebs.gss.server.ejb.ExternalAPI;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.rmi.PortableRemoteObject;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * The implementation of the file download servlet.
- *
- * @author past
- */
-public class FileDownload extends HttpServlet {
-	/**
-	 * The size of the buffer that is used to temporarily store chunks of
-	 * downloaded files, while pushing them out.
-	 */
-	private static final int DOWNLOAD_BUFFER_SIZE = 1024 * 4;
-
-	/**
-	 * The serial version UID of the class.
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * The logger.
-	 */
-	private static Log logger = LogFactory.getLog(FileDownload.class);
-
-	/**
-	 * A helper method that retrieves a reference to the ExternalAPI bean and
-	 * stores it for future use.
-	 *
-	 * @return an ExternalAPI instance
-	 * @throws RpcException in case an error occurs
-	 */
-	private ExternalAPI getService() throws RpcException {
-		try {
-			final Context ctx = new InitialContext();
-			final Object ref = ctx.lookup("gss/ExternalAPIBean/local");
-			return (ExternalAPI) PortableRemoteObject.narrow(ref, ExternalAPI.class);
-		} catch (final NamingException e) {
-			logger.error("Unable to retrieve the ExternalAPI EJB", e);
-			throw new RpcException("An error occurred while contacting the naming service");
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest,
-	 *      javax.servlet.http.HttpServletResponse)
-	 */
-	@Override
-	@SuppressWarnings("unchecked")
-	public void service(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
-		// Check that we have a file id in the request
-		if (request.getParameter("fileId") == null) {
-			logger.warn("No file header id in the request: " + request.getQueryString());
-			return;
-		}
-		// Check that we have a user id in the request
-		if (request.getParameter("userId") == null) {
-			logger.warn("No user id in the request: " + request.getQueryString());
-			return;
-		}
-		Long fileId = Long.valueOf(request.getParameter("fileId"));
-		Long userId = Long.valueOf(request.getParameter("userId"));
-
-		try {
-
-			FileHeaderDTO file = getService().getFile(userId, fileId);
-			InputStream contents = null;
-			if(request.getParameter("bodyId") ==  null){
-				contents = getService().getFileContents(userId, fileId);
-				response.reset();
-				response.setContentType(file.getMimeType());
-				response.setHeader("Content-disposition", "inline; filename*=UTF-8''"
-						+ file.getOriginalFilenameEncoded());
-				response.setContentLength ((int) file.getFileSize());
-			}
-			else{
-				Long bodyId = Long.valueOf(request.getParameter("bodyId"));
-				FileBodyDTO body = getService().getFileBody(userId, fileId, bodyId);
-				contents = getService().getFileContents(userId, fileId, bodyId);
-				response.reset();
-				response.setContentType(body.getMimeType());
-				response.setHeader("Content-disposition", "inline; filename*=UTF-8''"
-						+ body.getOriginalFilenameEncoded());
-				response.setContentLength ((int) body.getFileSize());
-			}
-
-			ServletOutputStream out = response.getOutputStream();
-			final byte[] buffer = new byte[DOWNLOAD_BUFFER_SIZE];
-			int n = 0;
-			try {
-				while (-1 != (n = contents.read(buffer)))
-					out.write(buffer, 0, n);
-			} finally {
-				contents.close();
-				out.close();
-			}
-		} catch (ObjectNotFoundException e) {
-			final String error = "A specified object was not found";
-			logger.error(error, e);
-			response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error);
-		} catch (RpcException e) {
-			final String error = "An error occurred while communicating with the service";
-			logger.error(error, e);
-			response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error);
-		} catch (InsufficientPermissionsException e) {
-			final String error = "Insufficient privileges for reading the specified file";
-			logger.error(error, e);
-			response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error);
-		}
-	}
-}
diff --git a/gss/src/gr/ebs/gss/server/FileUpload.java b/gss/src/gr/ebs/gss/server/FileUpload.java
deleted file mode 100644
index a901ba4..0000000
--- a/gss/src/gr/ebs/gss/server/FileUpload.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.
- *
- * This file is part of GSS.
- *
- * GSS is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GSS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GSS.  If not, see .
- */
-package gr.ebs.gss.server;
-
-import gr.ebs.gss.client.exceptions.DuplicateNameException;
-import gr.ebs.gss.client.exceptions.GSSIOException;
-import gr.ebs.gss.client.exceptions.InsufficientPermissionsException;
-import gr.ebs.gss.client.exceptions.ObjectNotFoundException;
-import gr.ebs.gss.client.exceptions.QuotaExceededException;
-import gr.ebs.gss.client.exceptions.RpcException;
-import gr.ebs.gss.server.ejb.ExternalAPI;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.rmi.PortableRemoteObject;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.fileupload.FileItemIterator;
-import org.apache.commons.fileupload.FileItemStream;
-import org.apache.commons.fileupload.FileUploadException;
-import org.apache.commons.fileupload.ProgressListener;
-import org.apache.commons.fileupload.servlet.ServletFileUpload;
-import org.apache.commons.fileupload.util.Streams;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * The implementation of the file upload servlet.
- *
- * @author past
- */
-public class FileUpload extends HttpServlet {
-
-	/**
-	 * The serial version UID of the class.
-	 */
-	private static final long serialVersionUID = 1L;
-
-	private static final int TRACK_PROGRESS_PERCENT = 5;
-
-	/**
-	 * The logger.
-	 */
-	private static Log logger = LogFactory.getLog(FileUpload.class);
-
-	/**
-	 * A helper method that retrieves a reference to the ExternalApi bean and
-	 * stores it for future use.
-	 *
-	 * @return an ExternalAPI instance
-	 * @throws RpcException in case an error occurs
-	 */
-	private ExternalAPI getService() throws RpcException {
-		try {
-			Context ctx = new InitialContext();
-			Object ref = ctx.lookup("gss/ExternalAPIBean/local");
-			return (ExternalAPI) PortableRemoteObject.narrow(ref, ExternalAPI.class);
-		} catch (NamingException e) {
-			logger.error("Unable to retrieve the ExternalAPI EJB", e);
-			throw new RpcException("An error occurred while contacting the naming service");
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest,
-	 *      javax.servlet.http.HttpServletResponse)
-	 */
-	@Override
-	@SuppressWarnings("unchecked")
-	public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
-		// Check that we have a file upload request
-		if (!ServletFileUpload.isMultipartContent(request)) {
-			logger.warn("Received non-multipart request: " + request.getQueryString());
-			return;
-		}
-
-		Long folderId = null;
-		Long fileHeaderId = null;
-		Long userId = null;
-		String fileName = null;
-
-		FileItemIterator iter;
-		File uploadedFile = null;
-		try {
-			// Create a new file upload handler.
-			ServletFileUpload upload = new ServletFileUpload();
-			StatusProgressListener progressListener = new StatusProgressListener(getService());
-			upload.setProgressListener(progressListener);
-			iter = upload.getItemIterator(request);
-			while (iter.hasNext()) {
-				FileItemStream item = iter.next();
-				String name = item.getFieldName();
-				InputStream stream = item.openStream();
-				if (item.isFormField()) {
-					final String value = Streams.asString(stream);
-					if (name.equals("folderId"))
-						folderId = Long.valueOf(value);
-					else if (name.equals("fileHeaderId"))
-						fileHeaderId = Long.valueOf(value);
-					else if (name.equals("userId"))
-						userId = Long.valueOf(value);
-				} else {
-
-					fileName = getFilename(item.getName());
-					progressListener.setUserId(userId);
-					progressListener.setFilename(fileName);
-					String contentType = item.getContentType();
-
-					try {
-						uploadedFile = getService().uploadFile(stream, userId);
-					} catch (IOException ex) {
-						throw new GSSIOException(ex, false);
-					}
-					if (fileHeaderId == null)
-						getService().createFile(userId, folderId, fileName, contentType, uploadedFile);
-					else
-						getService().updateFileContents(userId, fileHeaderId, contentType, uploadedFile);
-				}
-			}
-		} catch (FileUploadException e) {
-			String error = "Error while uploading file";
-			logger.error(error, e);
-			response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error);
-		} catch (GSSIOException e) {
-			if (uploadedFile != null && uploadedFile.exists())
-				uploadedFile.delete();
-			String error = "Error while uploading file";
-			if (e.logAsError())
-				logger.error(error, e);
-			else
-				logger.debug(error, e);
-			response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error);
-		} catch (DuplicateNameException e) {
-			if (uploadedFile != null && uploadedFile.exists())
-				uploadedFile.delete();
-			String error = "The specified file name already exists in this folder";
-			logger.error(error, e);
-			response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error);
-
-		} catch (InsufficientPermissionsException e) {
-			if (uploadedFile != null && uploadedFile.exists())
-				uploadedFile.delete();
-			String error = "You don't have the necessary permissions";
-			logger.error(error, e);
-			response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error);
-
-		} catch (QuotaExceededException e) {
-			if (uploadedFile != null && uploadedFile.exists())
-				uploadedFile.delete();
-			String error = "Not enough free space available";
-			if (logger.isDebugEnabled())
-				logger.debug(error, e);
-			response.sendError(HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE, error);
-
-		} catch (ObjectNotFoundException e) {
-			if (uploadedFile != null && uploadedFile.exists())
-				uploadedFile.delete();
-			String error = "A specified object was not found";
-			logger.error(error, e);
-			response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error);
-		} catch (RpcException e) {
-			if (uploadedFile != null && uploadedFile.exists())
-				uploadedFile.delete();
-			String error = "An error occurred while communicating with the service";
-			logger.error(error, e);
-			response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error);
-		}
-
-	}
-
-	/**
-	 * Returns the file name from a potential full path argument. Apparently IE
-	 * insists on sending the full path name of a file when uploading, forcing
-	 * us to trim the extra path info. Since this is only observed on Windows we
-	 * get to check for a single path separator value.
-	 *
-	 * @param name the potentially full path name of a file
-	 * @return the file name without extra path information
-	 */
-	private String getFilename(String name) {
-		int pathSepIndex = name.lastIndexOf("\\");
-		if (pathSepIndex == -1)
-			return name;
-		return name.substring(pathSepIndex + 1);
-	}
-
-	public static class StatusProgressListener implements ProgressListener {
-		private int percentLogged = 0;
-		private long bytesTransferred = 0;
-
-		private long fileSize = -100;
-
-		private long tenKBRead = -1;
-
-		private Long userId;
-
-		private String filename;
-
-		private ExternalAPI service;
-
-		public StatusProgressListener(ExternalAPI aService) {
-			service = aService;
-		}
-
-		/**
-		 * Modify the userId.
-		 *
-		 * @param aUserId the userId to set
-		 */
-		public void setUserId(Long aUserId) {
-			userId = aUserId;
-		}
-
-		/**
-		 * Modify the filename.
-		 *
-		 * @param aFilename the filename to set
-		 */
-		public void setFilename(String aFilename) {
-			filename = aFilename;
-		}
-
-		public void update(long bytesRead, long contentLength, int items) {
-			//monitoring per percent of bytes uploaded
-			bytesTransferred = bytesRead;
-			if (fileSize != contentLength)
-				fileSize = contentLength;
-			int percent = new Long(bytesTransferred * 100 / fileSize).intValue();
-
-			if (percent < 5 || percent % TRACK_PROGRESS_PERCENT == 0 )
-				if (percent != percentLogged){
-					percentLogged = percent;
-					try {
-						if (userId != null && filename != null)
-							service.createFileUploadProgress(userId, filename, bytesTransferred, fileSize);
-					} catch (ObjectNotFoundException e) {
-						// Swallow the exception since it is going to be caught
-						// by previously called methods
-					}
-				}
-		}
-	}
-}
diff --git a/gss/src/gr/ebs/gss/server/GSSServiceImpl.java b/gss/src/gr/ebs/gss/server/GSSServiceImpl.java
deleted file mode 100644
index db88c4d..0000000
--- a/gss/src/gr/ebs/gss/server/GSSServiceImpl.java
+++ /dev/null
@@ -1,636 +0,0 @@
-/*
- * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.
- *
- * This file is part of GSS.
- *
- * GSS is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GSS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GSS.  If not, see .
- */
-package gr.ebs.gss.server;
-
-import gr.ebs.gss.client.GSSService;
-import gr.ebs.gss.client.domain.FileBodyDTO;
-import gr.ebs.gss.client.domain.FileHeaderDTO;
-import gr.ebs.gss.client.domain.FolderDTO;
-import gr.ebs.gss.client.domain.GroupDTO;
-import gr.ebs.gss.client.domain.PermissionDTO;
-import gr.ebs.gss.client.domain.StatsDTO;
-import gr.ebs.gss.client.domain.UploadStatusDTO;
-import gr.ebs.gss.client.domain.UserDTO;
-import gr.ebs.gss.client.exceptions.DuplicateNameException;
-import gr.ebs.gss.client.exceptions.GSSIOException;
-import gr.ebs.gss.client.exceptions.InsufficientPermissionsException;
-import gr.ebs.gss.client.exceptions.ObjectNotFoundException;
-import gr.ebs.gss.client.exceptions.QuotaExceededException;
-import gr.ebs.gss.client.exceptions.RpcException;
-import gr.ebs.gss.server.domain.FileUploadStatus;
-import gr.ebs.gss.server.domain.User;
-import gr.ebs.gss.server.ejb.ExternalAPI;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.rmi.PortableRemoteObject;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import com.google.gwt.user.server.rpc.RemoteServiceServlet;
-
-/**
- * The implementation of the RPC service on the server.
- *
- * @author past
- */
-public class GSSServiceImpl extends RemoteServiceServlet implements GSSService {
-
-	/**
-	 * The serial version UID of the class.
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * The logger.
-	 */
-	private static Log logger = LogFactory.getLog(GSSServiceImpl.class);
-
-	/**
-	 * A helper method that retrieves a reference to the ExternalApi bean and
-	 * stores it for future use.
-	 *
-	 * @return an ExternalAPI instance
-	 * @throws RpcException in case an error occurs
-	 */
-	private ExternalAPI getService() throws RpcException {
-		try {
-			final Context ctx = new InitialContext();
-			final Object ref = ctx.lookup("gss/ExternalAPIBean/local");
-			return (ExternalAPI) PortableRemoteObject.narrow(ref, ExternalAPI.class);
-		} catch (final NamingException e) {
-			logger.error("Unable to retrieve the ExternalAPI EJB", e);
-			throw new RpcException("An error occurred while contacting the naming service");
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see gr.ebs.gss.client.GSSService#getGroups(java.lang.Long)
-	 */
-	public List getGroups(final Long userId) throws RpcException, ObjectNotFoundException {
-
-		return getService().getGroups(userId);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see gr.ebs.gss.client.GSSService#getUsers(java.lang.Long,
-	 *      java.lang.Long)
-	 */
-	public List getUsers(final Long userId, final Long groupId) throws RpcException, ObjectNotFoundException {
-		final List users = getService().getUsers(userId, groupId);
-		return users;
-	}
-
-	@Override
-	public FolderDTO getRootFolder(Long userId) throws RpcException, ObjectNotFoundException {
-		FolderDTO folder = getService().getRootFolder(userId);
-		if (folder.isDeleted())
-			throw new ObjectNotFoundException("Folder was not found");
-		trimDeleted(folder);
-		return folder;
-	}
-
-	@Override
-	public FolderDTO getFolder(Long userId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		FolderDTO folder = getService().getFolder(userId, folderId);
-		if (folder.isDeleted())
-			throw new ObjectNotFoundException("Folder was not found");
-		trimDeleted(folder);
-		return folder;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see gr.ebs.gss.client.GSSService#getFiles(java.lang.Long,
-	 *      java.lang.Long)
-	 */
-	public List getFiles(final Long userId, final Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		final List fileHeaders = getService().getFiles(userId, folderId);
-		return fileHeaders;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see gr.ebs.gss.client.GSSService#createFolder(java.lang.Long,
-	 *      java.lang.Long, java.lang.String)
-	 */
-	public void createFolder(final Long userId, final Long parentId, final String name) throws RpcException, DuplicateNameException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().createFolder(userId, parentId, name);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see gr.ebs.gss.client.GSSService#deleteFolder(java.lang.Long,
-	 *      java.lang.Long)
-	 */
-	public void deleteFolder(final Long userId, final Long folderId) throws RpcException, InsufficientPermissionsException, ObjectNotFoundException {
-		getService().deleteFolder(userId, folderId);
-	}
-
-	@Override
-	public List getSubfolders(Long userId, Long folderId)
-			throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		List folders = getService().getSubfolders(userId, folderId);
-		Iterator i = folders.iterator();
-		while (i.hasNext()) {
-			FolderDTO folder = i.next();
-			if (folder.isDeleted())
-				i.remove();
-			else
-				trimDeleted(folder);
-		}
-		return folders;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see gr.ebs.gss.client.GSSService#modifyFolder(java.lang.Long,
-	 *      java.lang.Long, java.lang.String)
-	 */
-	public void modifyFolder(final Long userId, final Long folderId, final String folderName) throws RpcException, InsufficientPermissionsException, ObjectNotFoundException, DuplicateNameException {
-		getService().modifyFolder(userId, folderId, folderName);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see gr.ebs.gss.client.GSSService#createGroup(java.lang.Long,
-	 *      java.lang.String)
-	 */
-	public void createGroup(final Long userId, final String name) throws RpcException, DuplicateNameException, ObjectNotFoundException {
-		getService().createGroup(userId, name);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see gr.ebs.gss.client.GSSService#deleteGroup(java.lang.Long,
-	 *      java.lang.Long)
-	 */
-	public void deleteGroup(final Long userId, final Long groupId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().deleteGroup(userId, groupId);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see gr.ebs.gss.client.GSSService#deleteFile(java.lang.Long,
-	 *      java.lang.Long)
-	 */
-	public void deleteFile(final Long userId, final Long fileId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().deleteFile(userId, fileId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getUserTags(java.lang.Long)
-	 */
-	public Set getUserTags(Long userId) throws RpcException, ObjectNotFoundException {
-		return getService().getUserTags(userId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#updateFile(java.lang.Long, java.lang.Long, java.lang.String, java.util.Set)
-	 */
-	public void updateFile(Long userId, Long fileId, String name, String tagSet) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().updateFile(userId, fileId, name, tagSet);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#copyFile(java.lang.Long, java.lang.Long, java.lang.String)
-	 */
-	public void copyFile(Long userId, Long fileId, String dest) throws RpcException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException, QuotaExceededException, GSSIOException {
-			getService().copyFile(userId, fileId, dest);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#copyFile(java.lang.Long, java.lang.Long, java.lang.Long, java.lang.String)
-	 */
-	public void copyFile(Long userId, Long fileId, Long destId, String destName) throws RpcException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException, QuotaExceededException, GSSIOException {
-			getService().copyFile(userId, fileId, destId, destName);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#markDeletedFile(java.lang.Long, java.lang.Long)
-	 */
-	public void moveFileToTrash(Long userId, Long fileId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().moveFileToTrash(userId, fileId);
-
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#copyFolder(java.lang.Long, java.lang.Long, java.lang.String)
-	 */
-	public void copyFolder(Long userId, Long folderId, String dest) throws RpcException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException {
-		getService().copyFolder(userId, folderId, dest);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#copyFolder(java.lang.Long, java.lang.Long, java.lang.Long, java.lang.String)
-	 */
-	public void copyFolder(Long userId, Long folderId, Long destId, String destName) throws RpcException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException {
-		getService().copyFolder(userId, folderId, destId, destName);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#copyFolderStructure(java.lang.Long, java.lang.Long, java.lang.Long, java.lang.String)
-	 */
-	public void copyFolderStructure(Long userId, Long folderId, Long destId, String destName) throws RpcException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException, QuotaExceededException, GSSIOException {
-		getService().copyFolderStructure(userId, folderId, destId, destName);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getUser(java.lang.String)
-	 */
-	public UserDTO getUser(String username) throws RpcException, ObjectNotFoundException {
-		if (username == null)
-			throw new ObjectNotFoundException("No username specified");
-		String usernameDecoded = null;
-		try {
-			usernameDecoded = URLDecoder.decode(username, "US-ASCII");
-		} catch (UnsupportedEncodingException e) {
-			throw new RpcException(e.getMessage());
-		}
-		User user = getService().findUser(usernameDecoded);
-		if (user == null)
-			throw new ObjectNotFoundException("Username not found");
-		return user.getDTO();
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#moveFile(java.lang.Long, java.lang.Long, java.lang.Long, java.lang.String)
-	 */
-	public void moveFile(Long userId, Long fileId, Long destId, String destName) throws RpcException, InsufficientPermissionsException, ObjectNotFoundException, DuplicateNameException, QuotaExceededException, GSSIOException {
-			getService().moveFile(userId, fileId, destId, destName);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#moveFolder(java.lang.Long, java.lang.Long, java.lang.Long, java.lang.String)
-	 */
-	public void moveFolder(Long userId, Long folderId, Long destId, String destName) throws RpcException, InsufficientPermissionsException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException, QuotaExceededException, GSSIOException {
-			getService().moveFolder(userId, folderId, destId, destName);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getDeletedFiles(java.lang.Long)
-	 */
-	public List getDeletedFiles(Long userId) throws RpcException, ObjectNotFoundException {
-		final List fileHeaders = getService().getDeletedFiles(userId);
-		return fileHeaders;
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#markUnDeletedFile(java.lang.Long, java.lang.Long)
-	 */
-	public void removeFileFromTrash(Long userId, Long fileId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().removeFileFromTrash(userId, fileId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#moveFolderToTrash(java.lang.Long, java.lang.Long)
-	 */
-	public void moveFolderToTrash(Long userId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().moveFolderToTrash(userId, folderId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#removeFolderFromTrash(java.lang.Long, java.lang.Long)
-	 */
-	public void removeFolderFromTrash(Long userId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().removeFolderFromTrash(userId, folderId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getDeletedRootFolders(java.lang.Long)
-	 */
-	public List getDeletedRootFolders(Long userId) throws RpcException, ObjectNotFoundException {
-		return getService().getDeletedRootFolders(userId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#emptyTrash(java.lang.Long)
-	 */
-	public void emptyTrash(Long userId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().emptyTrash(userId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#restoreTrash(java.lang.Long)
-	 */
-	public void restoreTrash(Long userId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().restoreTrash(userId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getFolderPermissions(java.lang.Long, java.lang.Long)
-	 */
-	@Override
-	public Set getFolderPermissions(Long userId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		return getService().getFolderPermissions(userId, folderId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#setFolderPermissions(java.lang.Long, java.lang.Long, java.util.Set)
-	 */
-	@Override
-	public void setFolderPermissions(Long userId, Long folderId, Set permissions) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().setFolderPermissions(userId, folderId, permissions);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getUsersByUserNameLike(java.lang.String)
-	 */
-	@Override
-	public List getUsersByUserNameLike(String username) throws RpcException {
-		return getService().getUsersByUserNameLike(username);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#addUserToGroup(java.lang.Long, java.lang.Long, java.lang.Long)
-	 */
-	@Override
-	public void addUserToGroup(Long userId, Long groupId, Long userToAddId) throws RpcException, ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException {
-		getService().addUserToGroup(userId, groupId, userToAddId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getSharedRootFolders(java.lang.Long)
-	 */
-	@Override
-	public List getSharedRootFolders(Long userId) throws RpcException, ObjectNotFoundException {
-		List res = getService().getSharedRootFolders(userId);
-		return res;
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#removeMemberFromGroup(java.lang.Long, java.lang.Long, java.lang.Long)
-	 */
-	@Override
-	public void removeMemberFromGroup(Long userId, Long groupId, Long memberId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().removeMemberFromGroup(userId, groupId, memberId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getUsersSharingFoldersForUser(java.lang.Long)
-	 */
-	@Override
-	public List getUsersSharingFoldersForUser(Long userId) throws RpcException, ObjectNotFoundException {
-		List res = getService().getUsersSharingFoldersForUser(userId);
-		return res;
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getFilePermissions(java.lang.Long, java.lang.Long)
-	 */
-	@Override
-	public Set getFilePermissions(Long userId, Long fileId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		return getService().getFilePermissions(userId, fileId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#setFilePermissions(java.lang.Long, java.lang.Long, java.util.Set)
-	 */
-	@Override
-	public void setFilePermissions(Long userId, Long fileId, boolean readForAll, Set permissions) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().setFilePermissions(userId, fileId, readForAll, permissions);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getSharedFiles(java.lang.Long)
-	 */
-	@Override
-	public List getSharedFiles(Long userId) throws RpcException, ObjectNotFoundException {
-		return getService().getSharedFilesNotInSharedFolders(userId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getSharedFiles(java.lang.Long, java.lang.Long)
-	 */
-	@Override
-	public List getSharedFiles(Long userId, Long callingUserId) throws RpcException, ObjectNotFoundException {
-		return getService().getSharedFiles(userId, callingUserId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getSharedRootFolders(java.lang.Long, java.lang.Long)
-	 */
-	@Override
-	public List getSharedRootFolders(Long userId, Long callingUserId) throws RpcException, ObjectNotFoundException {
-		return getService().getSharedRootFolders(userId, callingUserId);
-	}
-
-	@Override
-	public List getSharedSubfolders(Long userId, Long folderId) throws RpcException, ObjectNotFoundException {
-		List folders = getService().getSharedSubfolders(userId, folderId);
-		Iterator i = folders.iterator();
-		while (i.hasNext()) {
-			FolderDTO folder = i.next();
-			if (folder.isDeleted())
-				i.remove();
-			else
-				trimDeleted(folder);
-		}
-		return folders;
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#searchFiles(java.lang.Long, java.lang.String)
-	 */
-	@Override
-	public List searchFiles(Long userId, String query) throws ObjectNotFoundException, RpcException {
-		return getService().searchFiles(userId, query);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#copyFiles(java.lang.Long, java.util.List, java.lang.Long)
-	 */
-	@Override
-	public void copyFiles(Long userId, List fileIds, Long destId) throws ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException, RpcException, QuotaExceededException, GSSIOException {
-
-		getService().copyFiles(userId, fileIds, destId);
-
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#moveFiles(java.lang.Long, java.util.List, java.lang.Long)
-	 */
-	@Override
-	public void moveFiles(Long userId, List fileIds, Long destId) throws ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException, RpcException, QuotaExceededException, GSSIOException {
-		getService().moveFiles(userId, fileIds, destId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#deleteFiles(java.lang.Long, java.util.List)
-	 */
-	@Override
-	public void deleteFiles(Long userId, List fileIds) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().deleteFiles(userId, fileIds);
-
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#moveFilesToTrash(java.lang.Long, java.util.List)
-	 */
-	@Override
-	public void moveFilesToTrash(Long userId, List fileIds) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().moveFilesToTrash(userId, fileIds);
-
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#removeFilesFromTrash(java.lang.Long, java.util.List)
-	 */
-	@Override
-	public void removeFilesFromTrash(Long userId, List fileIds) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().removeFilesFromTrash(userId, fileIds);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getUserStatistics(java.lang.Long)
-	 */
-	@Override
-	public StatsDTO getUserStatistics(Long userId) throws RpcException, ObjectNotFoundException {
-		return getService().getUserStatistics(userId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getVersions(java.lang.Long, java.lang.Long)
-	 */
-	@Override
-	public List getVersions(Long userId, Long fileId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		return getService().getVersions(userId, fileId);
-
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#removeVersion(java.lang.Long, java.lang.Long, java.lang.Long)
-	 */
-	@Override
-	public void removeVersion(Long userId, Long fileId, Long bodyId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().removeVersion(userId, fileId, bodyId);
-
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#restoreVersion(java.lang.Long, java.lang.Long, java.lang.Long)
-	 */
-	@Override
-	public void restoreVersion(Long userId, Long fileId, Long bodyId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException, QuotaExceededException, GSSIOException {
-		getService().restoreVersion(userId, fileId, bodyId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#removeOldVersions(java.lang.Long, java.lang.Long)
-	 */
-	@Override
-	public void removeOldVersions(Long userId, Long fileId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().removeOldVersions(userId, fileId);
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#toggleFileVersioning(java.lang.Long, java.lang.Long, boolean)
-	 */
-	@Override
-	public void toggleFileVersioning(Long userId, Long fileId, boolean versioned) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		getService().toggleFileVersioning(userId, fileId, versioned);
-
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getUploadStatus()
-	 */
-	@Override
-	public UploadStatusDTO getUploadStatus(Long userId, String fileName) throws RpcException, ObjectNotFoundException {
-		FileUploadStatus status = getService().getFileUploadStatus(userId, fileName);
-		if(status == null)
-			return null;
-		UploadStatusDTO dto = new UploadStatusDTO();
-		dto.setBytesTransferred(status.getBytesUploaded());
-		dto.setFileSize(status.getFileSize());
-		if( status.getFileSize().equals(status.getBytesUploaded()))
-			getService().removeFileUploadProgress(userId, fileName);
-		return dto;
-
-	}
-
-	@Override
-	public FolderDTO getFolderWithSubfolders(Long userId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		FolderDTO folder = getService().getFolderWithSubfolders(userId, folderId);
-		if (folder.isDeleted())
-			throw new ObjectNotFoundException("Folder was not found");
-		trimDeleted(folder);
-		return folder;
-	}
-
-	/* (non-Javadoc)
-	 * @see gr.ebs.gss.client.GSSService#getSharedSubfolders(java.lang.Long, java.lang.Long, java.lang.Long)
-	 */
-	@Override
-	public List getSharedSubfolders(Long userId, Long callingUserId, Long folderId) throws RpcException, ObjectNotFoundException {
-		return getService().getSharedSubfolders(userId, callingUserId, folderId);
-	}
-
-	@Override
-	public FolderDTO getFolderWithSubfolders(Long userId, Long callingUserId, Long folderId) throws RpcException, ObjectNotFoundException, InsufficientPermissionsException {
-		FolderDTO folder = getService().getFolderWithSubfolders(userId, callingUserId, folderId);
-		if (folder.isDeleted())
-			throw new ObjectNotFoundException("Folder was not found");
-		trimDeleted(folder);
-		return folder;
-	}
-
-	/**
-	 * Removes the 1st & 2nd level subfolders of the specified folder that
-	 * have been moved into the trash.
-	 *
-	 * @param folder the folder whose children will be scanned
-	 */
-	private void trimDeleted(FolderDTO folder) {
-		Iterator i = folder.getSubfolders().iterator();
-		while (i.hasNext()) {
-			FolderDTO f = i.next();
-			if (f.isDeleted())
-				i.remove();
-			else {
-				Iterator i2 = f.getSubfolders().iterator();
-				while (i2.hasNext()) {
-					FolderDTO subf = i2.next();
-					if (subf.isDeleted())
-						i2.remove();
-				}
-			}
-		}
-	}
-
-}
diff --git a/gss/test/gr/ebs/gss/client/UserGroupsTest.java b/gss/test/gr/ebs/gss/client/UserGroupsTest.java
deleted file mode 100644
index cc09121..0000000
--- a/gss/test/gr/ebs/gss/client/UserGroupsTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.
- *
- * This file is part of GSS.
- *
- * GSS is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GSS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GSS.  If not, see .
- */
-package gr.ebs.gss.client;
-
-import gr.ebs.gss.client.domain.GroupDTO;
-
-import java.util.Iterator;
-import java.util.List;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.junit.client.GWTTestCase;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
-
-/**
- * A test case that verifies the behavior of the retrieval of the groups that
- * belong to a particular user.
- *
- * @author past
- */
-public class UserGroupsTest extends GWTTestCase {
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see com.google.gwt.junit.client.GWTTestCase#getModuleName()
-	 */
-	public String getModuleName() {
-		return "gr.ebs.gss.GSS";
-	}
-
-	/**
-	 * Perform the test of getting the groups that belong to a particular user.
-	 */
-	public void testUserGroups() {
-		delayTestFinish(10000);
-		getRemoteService().getGroups(new Long(1L), new AsyncCallback() {
-
-			public void onSuccess(final Object result) {
-				final List groupList = (List) result;
-				// Copy the ArrayList to an array, the Java 1.4 way
-				final GroupDTO[] g = new GroupDTO[groupList.size()];
-				final Iterator iter = groupList.iterator();
-				int j = 0;
-				while (iter.hasNext())
-					g[j++] = (GroupDTO) iter.next();
-
-				assertEquals(g[0].getName(), "EBS");
-				assertEquals(g[1].getName(), "Family");
-				assertNull(g[2]);
-				finishTest();
-			}
-
-			public void onFailure(final Throwable caught) {
-				fail(caught.toString());
-			}
-		});
-	}
-
-	/**
-	 * An RPC service proxy.
-	 */
-	private GSSServiceAsync service;
-
-	/**
-	 * Return the service proxy. If this is the first time it is requested, it
-	 * is then stored for subsequent requests.
-	 *
-	 * @return the service proxy
-	 */
-	private GSSServiceAsync getRemoteService() {
-		if (service == null) {
-			final GSSServiceAsync freshService = (GSSServiceAsync) GWT.create(GSSService.class);
-			final ServiceDefTarget endpoint = (ServiceDefTarget) freshService;
-			final String serviceUrl = "http://localhost:8080/gss/gss";
-			System.out.println(serviceUrl);
-			endpoint.setServiceEntryPoint(serviceUrl);
-			service = freshService;
-		}
-		return service;
-	}
-
-}
diff --git a/gss/war/WEB-INF/web.xml b/gss/war/WEB-INF/web.xml
index 61eaf1f..bf97dc5 100644
--- a/gss/war/WEB-INF/web.xml
+++ b/gss/war/WEB-INF/web.xml
@@ -9,18 +9,6 @@
 	        
 	    
         
-                GSSService
-                gr.ebs.gss.server.GSSServiceImpl
-        
-        
-                FileUpload
-                gr.ebs.gss.server.FileUpload
-        
-        
-                FileDownload
-                gr.ebs.gss.server.FileDownload
-        
-        
                 Login
                 gr.ebs.gss.server.Login
         
@@ -46,18 +34,6 @@
         
 
         
-                GSSService
-                /gss
-        
-        
-                FileUpload
-                /fileUpload
-        
-        
-                FileDownload
-                /fileDownload
-        
-        
                 Login
                 /login
         
-- 
1.7.10.4