Use different icons based on the file MIME type. This required sending the content...
authorpastith <devnull@localhost>
Tue, 31 Mar 2009 13:17:03 +0000 (13:17 +0000)
committerpastith <devnull@localhost>
Tue, 31 Mar 2009 13:17:03 +0000 (13:17 +0000)
38 files changed:
gss/src/gr/ebs/gss/client/FileContextMenu.java
gss/src/gr/ebs/gss/client/FileList.java
gss/src/gr/ebs/gss/client/VersionsList.java
gss/src/gr/ebs/gss/client/dnd/DnDDropController.java
gss/src/gr/ebs/gss/client/dnd/DnDFocusPanel.java
gss/src/gr/ebs/gss/client/rest/ExecuteGet.java
gss/src/gr/ebs/gss/client/rest/resource/FileResource.java
gss/src/gr/ebs/gss/client/rest/resource/FolderResource.java
gss/src/gr/ebs/gss/client/rest/resource/GroupResource.java
gss/src/gr/ebs/gss/client/rest/resource/GroupUserResource.java
gss/src/gr/ebs/gss/client/rest/resource/GroupsResource.java
gss/src/gr/ebs/gss/client/rest/resource/OtherUserResource.java
gss/src/gr/ebs/gss/client/rest/resource/OthersResource.java
gss/src/gr/ebs/gss/client/rest/resource/PermissionHolder.java
gss/src/gr/ebs/gss/client/rest/resource/QuotaHolder.java
gss/src/gr/ebs/gss/client/rest/resource/RestResource.java
gss/src/gr/ebs/gss/client/rest/resource/SearchResource.java
gss/src/gr/ebs/gss/client/rest/resource/SharedResource.java
gss/src/gr/ebs/gss/client/rest/resource/TagsResource.java
gss/src/gr/ebs/gss/client/rest/resource/TrashResource.java
gss/src/gr/ebs/gss/client/rest/resource/UploadStatusResource.java
gss/src/gr/ebs/gss/client/rest/resource/UserResource.java
gss/src/gr/ebs/gss/client/rest/resource/UserSearchResource.java
gss/src/gr/ebs/gss/resources/mimetypes/acroread.png [new file with mode: 0644]
gss/src/gr/ebs/gss/resources/mimetypes/ark2.png [new file with mode: 0644]
gss/src/gr/ebs/gss/resources/mimetypes/document_menu.png [deleted file]
gss/src/gr/ebs/gss/resources/mimetypes/html.png [new file with mode: 0644]
gss/src/gr/ebs/gss/resources/mimetypes/java.png [deleted file]
gss/src/gr/ebs/gss/resources/mimetypes/kcmfontinst.png [new file with mode: 0644]
gss/src/gr/ebs/gss/resources/mimetypes/knotify.png [new file with mode: 0644]
gss/src/gr/ebs/gss/resources/mimetypes/kpresenter_kpr.png [new file with mode: 0644]
gss/src/gr/ebs/gss/resources/mimetypes/log.png [new file with mode: 0644]
gss/src/gr/ebs/gss/resources/mimetypes/source_c.png [deleted file]
gss/src/gr/ebs/gss/resources/mimetypes/video2.png [new file with mode: 0644]
gss/src/gr/ebs/gss/server/rest/FilesHandler.java
gss/src/gr/ebs/gss/server/rest/OthersHandler.java
gss/src/gr/ebs/gss/server/rest/SharedHandler.java
gss/src/gr/ebs/gss/server/rest/TrashHandler.java

index 980f6ee..43d1be7 100644 (file)
@@ -33,7 +33,6 @@ import java.util.List;
 
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.ClickListener;
 import com.google.gwt.user.client.ui.MenuBar;
@@ -73,7 +72,7 @@ public class FileContextMenu extends PopupPanel implements ClickListener {
         */
        public interface Images extends FileMenu.Images, EditMenu.Images {
 
-               @Resource("gr/ebs/gss/resources/mimetypes/document_menu.png")
+               @Resource("gr/ebs/gss/resources/mimetypes/document.png")
                AbstractImagePrototype fileContextMenu();
 
                @Resource("gr/ebs/gss/resources/doc_versions.png")
@@ -82,12 +81,6 @@ public class FileContextMenu extends PopupPanel implements ClickListener {
                @Resource("gr/ebs/gss/resources/group.png")
                AbstractImagePrototype sharing();
 
-               /**
-                * Will bundle the file 'border_remove.png' residing in the package
-                * 'gr.ebs.gss.resources'.
-                *
-                * @return the image prototype
-                */
                @Resource("gr/ebs/gss/resources/border_remove.png")
                AbstractImagePrototype unselectAll();
        }
@@ -101,24 +94,15 @@ public class FileContextMenu extends PopupPanel implements ClickListener {
         *
         * @param newImages the image bundle passed on by the parent object
         */
-       public FileContextMenu(final Images newImages, boolean isTrash, boolean isEmpty) {
+       public FileContextMenu(Images newImages, boolean isTrash, boolean isEmpty) {
                // The popup's constructor's argument is a boolean specifying that it
                // auto-close itself when the user clicks outside of it.
                super(true);
                setAnimationEnabled(true);
                images = newImages;
 
-               // A dummy command that we will execute from unimplemented leaves.
-               final Command cmd = new Command() {
-
-                       public void execute() {
-                               hide();
-                               Window.alert("You selected a menu item!");
-                       }
-               };
-
                // The command that does some validation before downloading a file.
-               final Command downloadCmd = new Command() {
+               Command downloadCmd = new Command() {
 
                        public void execute() {
                                hide();
@@ -126,7 +110,7 @@ public class FileContextMenu extends PopupPanel implements ClickListener {
                        }
                };
 
-               final MenuBar contextMenu = new MenuBar(true);
+               MenuBar contextMenu = new MenuBar(true);
                if (isEmpty) {
                        if (GSS.get().getFolders().getCurrent() != null)
                                if (GSS.get().getFolders().isFileItem(GSS.get().getFolders().getCurrent()))
@@ -174,11 +158,8 @@ public class FileContextMenu extends PopupPanel implements ClickListener {
                        contextMenu.addItem(deleteItem);
                        contextMenu.addItem(sharingItem);
                        contextMenu.addItem(propItem);
-
                }
-
                add(contextMenu);
-
        }
 
        void onMultipleSelection() {
@@ -188,13 +169,7 @@ public class FileContextMenu extends PopupPanel implements ClickListener {
                sharingItem.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) {
-
+       public void onClick(Widget sender) {
                if (GSS.get().getCurrentSelection() != null)
                        if (GSS.get().getCurrentSelection() instanceof FileResource) {
                                FileResource res = (FileResource) GSS.get().getCurrentSelection();
@@ -208,7 +183,6 @@ public class FileContextMenu extends PopupPanel implements ClickListener {
                                menu.setPopupPosition(left, top);
                                menu.show();
                        } else if (GSS.get().getCurrentSelection() instanceof List) {
-                               List<FileResource> dto = (List<FileResource>) GSS.get().getCurrentSelection();
                                FileContextMenu menu;
                                if (GSS.get().getFolders().isTrashItem(GSS.get().getFolders().getCurrent()))
                                        menu = new FileContextMenu(images, true, false);
@@ -223,8 +197,7 @@ public class FileContextMenu extends PopupPanel implements ClickListener {
                        }
        }
 
-       public void onEvent(final Event event) {
-
+       public void onEvent(Event event) {
                if (GSS.get().getCurrentSelection() != null)
                        if (GSS.get().getCurrentSelection() instanceof FileResource) {
                                FileResource res = (FileResource) GSS.get().getCurrentSelection();
@@ -238,7 +211,6 @@ public class FileContextMenu extends PopupPanel implements ClickListener {
                                menu.setPopupPosition(left, top);
                                menu.show();
                        } else if (GSS.get().getCurrentSelection() instanceof List) {
-                               List<FileResource> dto = (List<FileResource>) GSS.get().getCurrentSelection();
                                FileContextMenu menu;
                                if (GSS.get().getFolders().isTrashItem(GSS.get().getFolders().getCurrent()))
                                        menu = new FileContextMenu(images, true, false);
index 80722fc..7945d81 100644 (file)
@@ -100,6 +100,33 @@ public class FileList extends Composite implements TableListener, ClickListener
 \r
                @Resource("gr/ebs/gss/resources/desc.png")\r
                AbstractImagePrototype desc();\r
+\r
+               @Resource("gr/ebs/gss/resources/mimetypes/kcmfontinst.png")\r
+               AbstractImagePrototype wordprocessor();\r
+\r
+               @Resource("gr/ebs/gss/resources/mimetypes/log.png")\r
+               AbstractImagePrototype spreadsheet();\r
+\r
+               @Resource("gr/ebs/gss/resources/mimetypes/kpresenter_kpr.png")\r
+               AbstractImagePrototype presentation();\r
+\r
+               @Resource("gr/ebs/gss/resources/mimetypes/acroread.png")\r
+               AbstractImagePrototype pdf();\r
+\r
+               @Resource("gr/ebs/gss/resources/mimetypes/image.png")\r
+               AbstractImagePrototype image();\r
+\r
+               @Resource("gr/ebs/gss/resources/mimetypes/video2.png")\r
+               AbstractImagePrototype video();\r
+\r
+               @Resource("gr/ebs/gss/resources/mimetypes/knotify.png")\r
+               AbstractImagePrototype audio();\r
+\r
+               @Resource("gr/ebs/gss/resources/mimetypes/html.png")\r
+               AbstractImagePrototype html();\r
+\r
+               @Resource("gr/ebs/gss/resources/mimetypes/ark2.png")\r
+               AbstractImagePrototype zip();\r
        }\r
 \r
        /**\r
@@ -161,7 +188,7 @@ public class FileList extends Composite implements TableListener, ClickListener
         *\r
         * @param _images\r
         */\r
-       public FileList(final Images _images) {\r
+       public FileList(Images _images) {\r
                images = _images;\r
 \r
                prevButton.addClickListener(this);\r
@@ -180,7 +207,7 @@ public class FileList extends Composite implements TableListener, ClickListener
                table.addTableListener(this);\r
 \r
                // Create the 'navigation' bar at the upper-right.\r
-               final HorizontalPanel innerNavBar = new HorizontalPanel();\r
+               HorizontalPanel innerNavBar = new HorizontalPanel();\r
                innerNavBar.setStyleName("gss-ListNavBar");\r
                innerNavBar.setSpacing(8);\r
                innerNavBar.add(prevButton);\r
@@ -228,6 +255,7 @@ public class FileList extends Composite implements TableListener, ClickListener
                }\r
        }\r
 \r
+       @Override\r
        public void onBrowserEvent(Event event) {\r
                if (files == null || files.size() == 0) {\r
                        if (DOM.eventGetType(event) == Event.ONCONTEXTMENU && selectedRows.size() == 0) {\r
@@ -247,8 +275,9 @@ public class FileList extends Composite implements TableListener, ClickListener
                                FileResource file = getSelectedFiles().get(0);\r
                                String dateString = AbstractRestCommand.getDate();\r
                                String resource = file.getPath().substring(GSS.GSS_REST_PATH.length() - 1, file.getPath().length());\r
-                               String sig = GSS.get().getCurrentUserResource().getUsername() + " " + AbstractRestCommand.calculateSig("GET", dateString, resource, AbstractRestCommand.base64decode(GSS.get()\r
-                                                                                                                                                                                                                                                                                                                                                                               .getToken()));\r
+                               String sig = GSS.get().getCurrentUserResource().getUsername() + " " +\r
+                                               AbstractRestCommand.calculateSig("GET", dateString, resource,\r
+                                               AbstractRestCommand.base64decode(GSS.get().getToken()));\r
                                Window.open(file.getPath() + "?Authorization=" + URL.encodeComponent(sig) + "&Date=" + URL.encodeComponent(dateString), "_blank", "");\r
                                event.preventDefault();\r
                                return;\r
@@ -269,7 +298,6 @@ public class FileList extends Composite implements TableListener, ClickListener
                                event.preventDefault();\r
                        }\r
                }\r
-\r
                super.onBrowserEvent(event);\r
        }\r
 \r
@@ -282,22 +310,17 @@ public class FileList extends Composite implements TableListener, ClickListener
                UserResource user = GSS.get().getCurrentUserResource();\r
                if (user == null)\r
                        return !DONE;\r
-               updateFileCache(true /*clear selection*/);\r
+               // Update cache and clear selection.\r
+               updateFileCache(true);\r
                return DONE;\r
        }\r
 \r
-       /*\r
-        * (non-Javadoc)\r
-        *\r
-        * @see com.google.gwt.user.client.ui.TableListener#onCellClicked(com.google.gwt.user.client.ui.SourcesTableEvents,\r
-        *      int, int)\r
-        */\r
-       public void onCellClicked(@SuppressWarnings("unused") SourcesTableEvents sender, int row, @SuppressWarnings("unused") int cell) {\r
+       public void onCellClicked(SourcesTableEvents sender, int row, int cell) {\r
                // Select the row that was clicked (-1 to account for header row).\r
                if (row > folderFileCount)\r
                        return;\r
                if (clickShift) {\r
-                       GWT.log("ROW is:" + row + " fs:" + firstShift, null);\r
+                       GWT.log("Row is: " + row + " fs: " + firstShift, null);\r
                        if (firstShift == -1)\r
                                firstShift = row;\r
                        else if (row > firstShift) {\r
@@ -315,7 +338,7 @@ public class FileList extends Composite implements TableListener, ClickListener
                                styleRow(row, true);\r
                                styleRow(row - 1, true);\r
                        } else if (row < firstShift) {\r
-                               GWT.log("ROW is:" + row + " fs:" + firstShift, null);\r
+                               GWT.log("Row is:" + row + " fs:" + firstShift, null);\r
                                clearSelectedRows();\r
 \r
                                for (int i = firstShift; i >= row - 1; i--) {\r
@@ -326,10 +349,8 @@ public class FileList extends Composite implements TableListener, ClickListener
                                makeRowDraggable(row);\r
                                contextMenu.setFiles(getSelectedFiles());\r
                        }\r
-\r
                } else if (row > 0)\r
                        selectRow(row - 1);\r
-\r
        }\r
 \r
        /**\r
@@ -337,14 +358,12 @@ public class FileList extends Composite implements TableListener, ClickListener
         * files.\r
         */\r
        private void initTable() {\r
-\r
                nameLabel = new HTML("Name");\r
                nameLabel.addClickListener(new ClickListener() {\r
 \r
                        public void onClick(Widget sender) {\r
                                sortFiles("name");\r
                                update();\r
-\r
                        }\r
 \r
                });\r
@@ -354,7 +373,6 @@ public class FileList extends Composite implements TableListener, ClickListener
                        public void onClick(Widget sender) {\r
                                sortFiles("version");\r
                                update();\r
-\r
                        }\r
 \r
                });\r
@@ -364,7 +382,6 @@ public class FileList extends Composite implements TableListener, ClickListener
                        public void onClick(Widget sender) {\r
                                sortFiles("size");\r
                                update();\r
-\r
                        }\r
 \r
                });\r
@@ -374,7 +391,6 @@ public class FileList extends Composite implements TableListener, ClickListener
                        public void onClick(Widget sender) {\r
                                sortFiles("date");\r
                                update();\r
-\r
                        }\r
 \r
                });\r
@@ -384,7 +400,6 @@ public class FileList extends Composite implements TableListener, ClickListener
                        public void onClick(Widget sender) {\r
                                sortFiles("owner");\r
                                update();\r
-\r
                        }\r
 \r
                });\r
@@ -394,7 +409,6 @@ public class FileList extends Composite implements TableListener, ClickListener
                        public void onClick(Widget sender) {\r
                                sortFiles("path");\r
                                update();\r
-\r
                        }\r
 \r
                });\r
@@ -431,7 +445,6 @@ public class FileList extends Composite implements TableListener, ClickListener
                }\r
                prevButton.setVisible(false);\r
                nextButton.setVisible(false);\r
-\r
        }\r
 \r
        /**\r
@@ -447,11 +460,8 @@ public class FileList extends Composite implements TableListener, ClickListener
                                        selectedRows.remove(i);\r
                                        styleRow(row, false);\r
                                } else {\r
-                                       //for (int r : selectedRows) int prow = r - startIndex;\r
-                                       //table.setWidget(prow + 1, 0, images.document().createImage());\r
                                        selectedRows.add(startIndex + row);\r
                                        styleRow(row, true);\r
-\r
                                }\r
                        else if (selectedRows.size() == 1 && selectedRows.contains(row))\r
                                clearSelectedRows();\r
@@ -466,9 +476,7 @@ public class FileList extends Composite implements TableListener, ClickListener
                                GSS.get().setCurrentSelection(getSelectedFiles());\r
                        contextMenu.setFiles(getSelectedFiles());\r
                        makeRowDraggable(row+1);\r
-\r
                }\r
-\r
        }\r
 \r
        public List<FileResource> getSelectedFiles() {\r
@@ -513,21 +521,20 @@ public class FileList extends Composite implements TableListener, ClickListener
                                break;\r
                        // Add a new row to the table, then set each of its columns to the\r
                        // proper values.\r
-                       table.setWidget(i, 0, images.document().createImage());\r
-                       FileResource fileHeader = files.get(startIndex + i - 1);\r
+                       FileResource file = files.get(startIndex + i - 1);\r
+                       table.setWidget(i, 0, getFileIcon(file).createImage());\r
                        table.getRowFormatter().addStyleName(i, "gss-fileRow");\r
 \r
-                       table.setHTML(i, 1, fileHeader.getName());\r
-                       table.setText(i, 2, fileHeader.getOwner());\r
-                       table.setText(i, 3, URL.decodeComponent(fileHeader      .getPath()\r
-                                                                                                                               .substring(GSS.GSS_REST_PATH.length() + fileHeader.getOwner().length() + 6, fileHeader  .getPath()\r
-                                                                                                                                                                                                                                                                                                               .length() - fileHeader  .getName()\r
-                                                                                                                                                                                                                                                                                                                                                               .length())));\r
-                       table.setText(i, 4, String.valueOf(fileHeader.getVersion()));\r
-                       table.setText(i, 5, String.valueOf(fileHeader.getFileSizeAsString()));\r
+                       table.setHTML(i, 1, file.getName());\r
+                       table.setText(i, 2, file.getOwner());\r
+                       table.setText(i, 3, URL.decodeComponent(file.getPath().substring(\r
+                                               GSS.GSS_REST_PATH.length() + file.getOwner().length() + 6,\r
+                                               file.getPath().length() - file.getName().length())));\r
+                       table.setText(i, 4, String.valueOf(file.getVersion()));\r
+                       table.setText(i, 5, String.valueOf(file.getFileSizeAsString()));\r
                        final DateTimeFormat formatter = DateTimeFormat.getFormat("d/M/yyyy h:mm a");\r
-                       table.setText(i, 6, formatter.format(fileHeader.getCreationDate()));\r
-                       folderTotalSize += fileHeader.getContentLength();\r
+                       table.setText(i, 6, formatter.format(file.getCreationDate()));\r
+                       folderTotalSize += file.getContentLength();\r
                }\r
 \r
                // Clear any remaining slots.\r
@@ -564,6 +571,38 @@ public class FileList extends Composite implements TableListener, ClickListener
        }\r
 \r
        /**\r
+        * Return the proper icon based on the MIME type of the file.\r
+        *\r
+        * @param file\r
+        * @return the icon\r
+        */\r
+       private AbstractImagePrototype getFileIcon(FileResource file) {\r
+               String mimetype = file.getContentType();\r
+               if (mimetype == null)\r
+                       return images.document();\r
+               else if ("application/pdf".equalsIgnoreCase(mimetype))\r
+                       return images.pdf();\r
+               else if ("application/vnd.ms-excel".equalsIgnoreCase(mimetype))\r
+                       return images.spreadsheet();\r
+               else if ("application/msword".equalsIgnoreCase(mimetype))\r
+                       return images.wordprocessor();\r
+               else if ("application/vnd.ms-powerpoint".equalsIgnoreCase(mimetype))\r
+                       return images.presentation();\r
+               else if ("application/zip".equalsIgnoreCase(mimetype))\r
+                       return images.zip();\r
+               else if ("text/html".equalsIgnoreCase(mimetype))\r
+                       return images.html();\r
+               else if (mimetype.startsWith("image/"))\r
+                       return images.image();\r
+               else if (mimetype.startsWith("video/"))\r
+                       return images.video();\r
+               else if (mimetype.startsWith("audio/"))\r
+                       return images.audio();\r
+               else\r
+                       return images.document();\r
+       }\r
+\r
+       /**\r
         *  update status panel with currently showing file stats\r
         */\r
        public void updateCurrentlyShowingStats() {\r
@@ -580,13 +619,11 @@ public class FileList extends Composite implements TableListener, ClickListener
                // Fill the rest with empty slots.\r
                if (newHeight > table.getOffsetHeight())\r
                        while (newHeight > table.getOffsetHeight()) {\r
-                               // table.setHTML(table.getRowCount(), 5, "&nbsp;");\r
                                table.resizeRows(table.getRowCount() + 1);\r
                                GWT.log("Table: " + table.getOffsetHeight() + ", rows: " + table.getRowCount(), null);\r
                        }\r
                else\r
                        while (newHeight < table.getOffsetHeight()) {\r
-                               // table.setHTML(table.getRowCount(), 5, "&nbsp;");\r
                                table.resizeRows(table.getRowCount() - 1);\r
                                GWT.log("Table: " + table.getOffsetHeight() + ", rows: " + table.getRowCount(), null);\r
                        }\r
@@ -601,6 +638,7 @@ public class FileList extends Composite implements TableListener, ClickListener
 \r
                                ExecuteGet<FolderResource> gf = new ExecuteGet<FolderResource>(FolderResource.class, folderItem.getFolderResource().getPath()) {\r
 \r
+                                       @Override\r
                                        public void onComplete() {\r
                                                folderItem.setUserObject(getResult());\r
                                                updateFileCache(clearSelection);\r
@@ -616,11 +654,13 @@ public class FileList extends Composite implements TableListener, ClickListener
                        } else if (folderItem.getTrashResource() != null) {\r
                                ExecuteGet<TrashResource> gt = new ExecuteGet<TrashResource>(TrashResource.class, folderItem.getTrashResource().getPath()) {\r
 \r
+                                       @Override\r
                                        public void onComplete() {\r
                                                folderItem.setUserObject(getResult());\r
                                                updateFileCache(clearSelection);\r
                                        }\r
 \r
+                                       @Override\r
                                        public void onError(Throwable t) {\r
                                                if (t instanceof RestException && (((RestException) t).getHttpStatusCode() == 204 || ((RestException) t).getHttpStatusCode() == 1223)) {\r
                                                        folderItem.setUserObject(new TrashResource(folderItem.getTrashResource().getPath()));\r
@@ -635,37 +675,36 @@ public class FileList extends Composite implements TableListener, ClickListener
                        } else if (folderItem.getSharedResource() != null) {\r
                                ExecuteGet<SharedResource> gt = new ExecuteGet<SharedResource>(SharedResource.class, folderItem.getSharedResource().getPath()) {\r
 \r
+                                       @Override\r
                                        public void onComplete() {\r
                                                folderItem.setUserObject(getResult());\r
                                                updateFileCache(clearSelection);\r
                                        }\r
 \r
+                                       @Override\r
                                        public void onError(Throwable t) {\r
-\r
                                                GWT.log("", t);\r
                                                GSS.get().displayError("Unable to fetch My Shares resource");\r
-\r
                                        }\r
                                };\r
                                DeferredCommand.addCommand(gt);\r
                        } else if (folderItem.getOtherUserResource() != null) {\r
                                ExecuteGet<OtherUserResource> gt = new ExecuteGet<OtherUserResource>(OtherUserResource.class, folderItem.getOtherUserResource().getPath()) {\r
 \r
+                                       @Override\r
                                        public void onComplete() {\r
                                                folderItem.setUserObject(getResult());\r
                                                updateFileCache(clearSelection);\r
                                        }\r
 \r
+                                       @Override\r
                                        public void onError(Throwable t) {\r
-\r
                                                GWT.log("", t);\r
                                                GSS.get().displayError("Unable to fetch My Shares resource");\r
-\r
                                        }\r
                                };\r
                                DeferredCommand.addCommand(gt);\r
                        }\r
-\r
                } else\r
                        updateFileCache(clearSelection);\r
        }\r
@@ -713,9 +752,6 @@ public class FileList extends Composite implements TableListener, ClickListener
 \r
        /**\r
         * Fill the file cache with data.\r
-        *\r
-        * @param _files\r
-        * @param filePaths the files to set\r
         */\r
        public void setFiles(final List<FileResource> _files) {\r
                if (_files.size() > 0 && !GSS.get().getFolders().isTrash(GSS.get().getFolders().getCurrent())) {\r
@@ -729,7 +765,6 @@ public class FileList extends Composite implements TableListener, ClickListener
 \r
                        public int compare(FileResource arg0, FileResource arg1) {\r
                                return arg0.getName().compareTo(arg1.getName());\r
-\r
                        }\r
 \r
                });\r
@@ -835,7 +870,6 @@ public class FileList extends Composite implements TableListener, ClickListener
                for (int r : selectedRows) {\r
                        int row = r - startIndex;\r
                        styleRow(row, false);\r
-                       //table.setWidget(row + 1, 0, images.document().createImage());\r
                }\r
                selectedRows.clear();\r
                Object sel = GSS.get().getCurrentSelection();\r
@@ -881,8 +915,9 @@ public class FileList extends Composite implements TableListener, ClickListener
 \r
        private void makeRowDraggable(int row){\r
                int contextRow = getWidgetRow(contextMenu, table);\r
-               if(contextRow != -1)\r
-                       table.setWidget(contextRow, 0,images.document().createImage());\r
+               if (contextRow != -1)\r
+                       table.setWidget(contextRow, 0, getFileIcon(files.get(contextRow - 1)).createImage());\r
+               contextMenu.setWidget(new HTML(getFileIcon(files.get(row - 1)).getHTML()));\r
                table.setWidget(row, 0, contextMenu);\r
        }\r
 \r
index f703116..d89a064 100644 (file)
@@ -53,8 +53,6 @@ public class VersionsList extends Composite {
 
        List<FileResource> versions = null;
 
-       private List<FileResource> newVersions = null;
-
        final Images images;
 
        final VerticalPanel permPanel = new VerticalPanel();
@@ -65,11 +63,11 @@ public class VersionsList extends Composite {
 
        FilePropertiesDialog container;
 
-       public VersionsList(FilePropertiesDialog container, final Images images, List<FileResource> versions) {
-               this.images = images;
-               this.container = container;
-               this.versions = versions;
-               Collections.sort(versions, new Comparator<FileResource>(){
+       public VersionsList(FilePropertiesDialog aContainer, final Images theImages, List<FileResource> theVersions) {
+               images = theImages;
+               container = aContainer;
+               versions = theVersions;
+               Collections.sort(theVersions, new Comparator<FileResource>(){
 
                        public int compare(FileResource o1, FileResource o2) {
                                return o1.getVersion().compareTo(o2.getVersion());
@@ -82,7 +80,6 @@ public class VersionsList extends Composite {
                permTable.setText(0, 3, "Size");
                permTable.setText(0, 4, "");
                permTable.setText(0, 5, "");
-               //permTable.setText(0, 6, "");
                permTable.getFlexCellFormatter().setStyleName(0, 0, "props-toplabels");
                permTable.getFlexCellFormatter().setStyleName(0, 1, "props-toplabels");
                permTable.getFlexCellFormatter().setStyleName(0, 2, "props-toplabels");
@@ -123,7 +120,6 @@ public class VersionsList extends Composite {
                        HTML downloadHtml = new HTML(link[0]+images.download().getHTML()+"<span>View This Version</span>"+link[1]);
                        permTable.setWidget(i, 4, downloadHtml);
                        permTable.setWidget(i, 5, restoreVersion);
-                       //permTable.setWidget(i, 6, removeButton);
                        permTable.getFlexCellFormatter().setStyleName(i, 0, "props-labels");
                        permTable.getFlexCellFormatter().setHorizontalAlignment(i, 0, HasHorizontalAlignment.ALIGN_CENTER);
                        permTable.getFlexCellFormatter().setHorizontalAlignment(i, 1, HasHorizontalAlignment.ALIGN_CENTER);
@@ -134,7 +130,6 @@ public class VersionsList extends Composite {
                }
                for (; i < permTable.getRowCount(); i++)
                        permTable.removeRow(i);
-
        }
 
        void createDownloadLink(String[] link, FileResource file) {
@@ -148,12 +143,14 @@ public class VersionsList extends Composite {
        void removeVersion(final FileResource version) {
                ExecuteDelete df = new ExecuteDelete(version.getPath()){
 
+                       @Override
                        public void onComplete() {
                                toRemove = version;
                                updateTable();
                                GSS.get().getFileList().updateFileCache(false, true /*clear selection*/);
                        }
 
+                       @Override
                        public void onError(Throwable t) {
                                GWT.log("", t);
                                if(t instanceof RestException){
@@ -178,23 +175,23 @@ public class VersionsList extends Composite {
                ExecutePost ep = new ExecutePost(selectedFile.getPath()+"?restoreVersion="+version.getVersion(),"",200){
 
 
+                       @Override
                        public void onComplete() {
                                container.hide();
                 GSS.get().getFileList().updateFileCache(true, true /*clear selection*/);
                        }
 
+                       @Override
                        public void onError(Throwable t) {
                                GWT.log("", t);
                                if(t instanceof RestException)
                                        GSS.get().displayError("Unable to restore version:"+((RestException)t).getHttpStatusText());
                                else
                                        GSS.get().displayError("System error restoring version:"+t.getMessage());
-
                        }
 
                };
                DeferredCommand.addCommand(ep);
-
        }
 
        private String formatDate(Date date){
index 0365e89..8114a62 100644 (file)
@@ -34,17 +34,12 @@ public class DnDDropController extends SimpleDropController {
 
        DnDFocusPanel nodeHolder;
 
-       /**
-        *
-        */
        public DnDDropController(DnDFocusPanel widget) {
                super(widget);
                nodeHolder = widget;
        }
 
-       /* (non-Javadoc)
-        * @see com.allen_sauer.gwt.dnd.client.drop.AbstractDropController#onDrop(com.allen_sauer.gwt.dnd.client.DragContext)
-        */
+       @Override
        public void onDrop(DragContext context) {
                super.onDrop(context);
                DnDFocusPanel toDrop = (DnDFocusPanel) context.draggable;
@@ -52,8 +47,7 @@ public class DnDDropController extends SimpleDropController {
                        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)
+                               if (nodeHolder.getItem().getUserObject() instanceof FolderResource)
                                        initialFolder = (FolderResource) nodeHolder.getItem().getUserObject();
                                boolean othersShared = false;
                                if (GSS.get().getFolders().isOthersSharedItem(nodeHolder.getItem()))
index 6c75ba4..dfeb081 100644 (file)
@@ -31,18 +31,17 @@ import com.google.gwt.user.client.ui.Widget;
  * @author kman
  *
  */
-public class DnDFocusPanel extends FocusPanel{
+public class DnDFocusPanel extends FocusPanel {
        private DnDTreeItem item;
        private List<FileResource> files;
 
-       public DnDFocusPanel(Widget widget,DnDTreeItem item){
+       public DnDFocusPanel(Widget widget, DnDTreeItem anItem) {
                super(widget);
-               this.item = item;
+               item = anItem;
        }
 
        public DnDFocusPanel(Widget widget){
                super(widget);
-
        }
 
        /**
@@ -54,12 +53,6 @@ public class DnDFocusPanel extends FocusPanel{
                return item;
        }
 
-
-
-
-
-
-
        /**
         * Retrieve the files.
         *
@@ -69,14 +62,13 @@ public class DnDFocusPanel extends FocusPanel{
                return files;
        }
 
-
        /**
         * Modify the files.
         *
-        * @param files the files to set
+        * @param newFiles the files to set
         */
-       public void setFiles(List<FileResource> files) {
-               this.files = files;
+       public void setFiles(List<FileResource> newFiles) {
+               files = newFiles;
        }
 
        public HTML cloneHTML(){
index 521825c..3502154 100644 (file)
@@ -17,6 +17,7 @@
  * along with GSS.  If not, see <http://www.gnu.org/licenses/>.
  */
 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;
@@ -37,11 +38,8 @@ import gr.ebs.gss.client.rest.resource.UserSearchResource;
 import com.google.gwt.http.client.Request;
 import com.google.gwt.http.client.Response;
 
-
-
 /**
  * @author kman
- *
  */
 public abstract class ExecuteGet<T extends RestResource> extends AbstractRestCommand{
 
@@ -49,15 +47,15 @@ public abstract class ExecuteGet<T extends RestResource> extends AbstractRestCom
        T result = null;
        Class<T> aclass;
 
-       public ExecuteGet(Class<T> aclass, String pathToGet){
-               this(aclass,pathToGet,true);
+       public ExecuteGet(Class<T> theclass, String pathToGet){
+               this(theclass,pathToGet,true);
        }
 
-       public ExecuteGet(Class<T> aclass, String pathToGet, boolean showLoading){
+       public ExecuteGet(Class<T> theclass, String pathToGet, boolean showLoading){
                setShowLoadingIndicator(showLoading);
                if(isShowLoadingIndicator())
                        GSS.get().showLoadingIndicator();
-               this.aclass = aclass;
+               this.aclass = theclass;
                final String path;
                if(pathToGet.indexOf("?") != -1)
                        path = pathToGet;
@@ -69,15 +67,18 @@ public abstract class ExecuteGet<T extends RestResource> extends AbstractRestCom
                        handleHeaders(builder, path);
                        builder.sendRequest("", new RestCallback(path) {
 
+                               @Override
                                public Object deserialize(Response response) {
                                        return deserializeResponse(path, response);
                                }
 
+                               @Override
                                public void handleError(Request request, Throwable exception) {
                                        complete = true;
                                        ExecuteGet.this.onError(exception);
                                }
 
+                               @Override
                                public void handleSuccess(Object object) {
                                        result = (T) object;
                                        complete = true;
@@ -90,15 +91,15 @@ public abstract class ExecuteGet<T extends RestResource> extends AbstractRestCom
                }
        }
 
-       public ExecuteGet(Class<T> aclass, String username , String pathToGet){
-               this(aclass,username, pathToGet, true);
+       public ExecuteGet(Class<T> theclass, String username , String pathToGet){
+               this(theclass,username, pathToGet, true);
        }
 
-       public ExecuteGet(Class<T> aclass, String username , String pathToGet, boolean showLoading){
+       public ExecuteGet(Class<T> theclass, String username , String pathToGet, boolean showLoading){
                setShowLoadingIndicator(showLoading);
                if(isShowLoadingIndicator())
                        GSS.get().showLoadingIndicator();
-               this.aclass = aclass;
+               this.aclass = theclass;
                final String path = fixPath(pathToGet);
                RestRequestBuilder builder = new RestRequestBuilder("GET", path);
 
@@ -106,15 +107,18 @@ public abstract class ExecuteGet<T extends RestResource> extends AbstractRestCom
                        handleHeaders(username, builder, path);
                        builder.sendRequest("", new RestCallback(path) {
 
+                               @Override
                                public Object deserialize(Response response) {
                                        return deserializeResponse(path, response);
                                }
 
+                               @Override
                                public void handleError(Request request, Throwable exception) {
                                        complete = true;
                                        ExecuteGet.this.onError(exception);
                                }
 
+                               @Override
                                public void handleSuccess(Object object) {
                                        result = (T) object;
                                        complete = true;
@@ -147,12 +151,11 @@ public abstract class ExecuteGet<T extends RestResource> extends AbstractRestCom
                return true;
        }
 
-       public  Object deserializeResponse(String path, Response response){
+       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);
@@ -167,62 +170,48 @@ public abstract class ExecuteGet<T extends RestResource> extends AbstractRestCom
                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(UserSearchResource.class)){
                        result1 = new UserSearchResource(path);
                        result1.createFromJSON(response.getText());
-
                }
                else if(aclass.equals(UploadStatusResource.class)){
                        result1 = new UploadStatusResource(path);
                        result1.createFromJSON(response.getText());
-
                }
                return result1;
-
        }
 
-
-
 }
index 14a06a3..047e892 100644 (file)
@@ -37,12 +37,8 @@ import com.google.gwt.json.client.JSONString;
  */
 public class FileResource extends RestResource {
 
-       /**
-        * @param path
-        */
-       public FileResource(String path) {
-               super(path);
-               // TODO Auto-generated constructor stub
+       public FileResource(String aPath) {
+               super(aPath);
        }
 
        String name;
@@ -89,10 +85,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the name.
         *
-        * @param name the name to set
+        * @param aName the name to set
         */
-       public void setName(String name) {
-               this.name = name;
+       public void setName(String aName) {
+               name = aName;
        }
 
        /**
@@ -107,10 +103,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the owner.
         *
-        * @param owner the owner to set
+        * @param newOwner the owner to set
         */
-       public void setOwner(String owner) {
-               this.owner = owner;
+       public void setOwner(String newOwner) {
+               owner = newOwner;
        }
 
        /**
@@ -125,10 +121,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the createdBy.
         *
-        * @param createdBy the createdBy to set
+        * @param aCreatedBy the createdBy to set
         */
-       public void setCreatedBy(String createdBy) {
-               this.createdBy = createdBy;
+       public void setCreatedBy(String aCreatedBy) {
+               createdBy = aCreatedBy;
        }
 
        /**
@@ -143,10 +139,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the modifiedBy.
         *
-        * @param modifiedBy the modifiedBy to set
+        * @param aModifiedBy the modifiedBy to set
         */
-       public void setModifiedBy(String modifiedBy) {
-               this.modifiedBy = modifiedBy;
+       public void setModifiedBy(String aModifiedBy) {
+               modifiedBy = aModifiedBy;
        }
 
        /**
@@ -161,10 +157,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the creationDate.
         *
-        * @param creationDate the creationDate to set
+        * @param aCreationDate the creationDate to set
         */
-       public void setCreationDate(Date creationDate) {
-               this.creationDate = creationDate;
+       public void setCreationDate(Date aCreationDate) {
+               creationDate = aCreationDate;
        }
 
        /**
@@ -179,10 +175,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the modificationDate.
         *
-        * @param modificationDate the modificationDate to set
+        * @param aModificationDate the modificationDate to set
         */
-       public void setModificationDate(Date modificationDate) {
-               this.modificationDate = modificationDate;
+       public void setModificationDate(Date aModificationDate) {
+               modificationDate = aModificationDate;
        }
 
        /**
@@ -197,10 +193,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the contentType.
         *
-        * @param contentType the contentType to set
+        * @param newContentType the contentType to set
         */
-       public void setContentType(String contentType) {
-               this.contentType = contentType;
+       public void setContentType(String newContentType) {
+               contentType = newContentType;
        }
 
        /**
@@ -215,10 +211,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the contentLength.
         *
-        * @param contentLength the contentLength to set
+        * @param newContentLength the contentLength to set
         */
-       public void setContentLength(Long contentLength) {
-               this.contentLength = contentLength;
+       public void setContentLength(Long newContentLength) {
+               contentLength = newContentLength;
        }
 
        /**
@@ -233,10 +229,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the readForAll.
         *
-        * @param readForAll the readForAll to set
+        * @param newReadForAll the readForAll to set
         */
-       public void setReadForAll(boolean readForAll) {
-               this.readForAll = readForAll;
+       public void setReadForAll(boolean newReadForAll) {
+               readForAll = newReadForAll;
        }
 
        /**
@@ -251,10 +247,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the versioned.
         *
-        * @param versioned the versioned to set
+        * @param newVersioned the versioned to set
         */
-       public void setVersioned(boolean versioned) {
-               this.versioned = versioned;
+       public void setVersioned(boolean newVersioned) {
+               versioned = newVersioned;
        }
 
        /**
@@ -269,10 +265,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the version.
         *
-        * @param version the version to set
+        * @param aVersion the version to set
         */
-       public void setVersion(Integer version) {
-               this.version = version;
+       public void setVersion(Integer aVersion) {
+               version = aVersion;
        }
 
        /**
@@ -287,10 +283,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the etag.
         *
-        * @param etag the etag to set
+        * @param anEtag the etag to set
         */
-       public void setEtag(String etag) {
-               this.etag = etag;
+       public void setEtag(String anEtag) {
+               etag = anEtag;
        }
 
        /**
@@ -305,10 +301,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the tags.
         *
-        * @param tags the tags to set
+        * @param newTags the tags to set
         */
-       public void setTags(List<String> tags) {
-               this.tags = tags;
+       public void setTags(List<String> newTags) {
+               tags = newTags;
        }
 
        /**
@@ -323,10 +319,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the permissions.
         *
-        * @param permissions the permissions to set
+        * @param newPermissions the permissions to set
         */
-       public void setPermissions(Set<PermissionHolder> permissions) {
-               this.permissions = permissions;
+       public void setPermissions(Set<PermissionHolder> newPermissions) {
+               permissions = newPermissions;
        }
 
        /**
@@ -341,10 +337,10 @@ public class FileResource extends RestResource {
        /**
         * Modify the deleted.
         *
-        * @param deleted the deleted to set
+        * @param newDeleted the deleted to set
         */
-       public void setDeleted(boolean deleted) {
-               this.deleted = deleted;
+       public void setDeleted(boolean newDeleted) {
+               deleted = newDeleted;
        }
 
        /**
@@ -359,17 +355,19 @@ public class FileResource extends RestResource {
        /**
         * Modify the folderURI.
         *
-        * @param folderURI the folderURI to set
+        * @param aFolderURI the folderURI to set
         */
-       public void setFolderURI(String folderURI) {
-               this.folderURI = folderURI;
+       public void setFolderURI(String aFolderURI) {
+               folderURI = aFolderURI;
        }
 
+       @Override
        public void createFromJSON(String text) {
                JSONObject metadata = (JSONObject) JSONParser.parse(text);
                name = unmarshallString(metadata, "name");
                name = URL.decodeComponent(name);
                owner = unmarshallString(metadata, "owner");
+               contentType = unmarshallString(metadata, "content");
                readForAll = unmarshallBoolean(metadata, "readForAll");
                versioned = unmarshallBoolean(metadata, "versioned");
 
index 0dac89f..5d0dc90 100644 (file)
@@ -39,11 +39,8 @@ import com.google.gwt.json.client.JSONParser;
  */
 public class FolderResource extends RestResource {
 
-       /**
-        * @param path
-        */
-       public FolderResource(String path) {
-               super(path);
+       public FolderResource(String aPath) {
+               super(aPath);
        }
 
        String name;
@@ -86,10 +83,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the name.
         *
-        * @param name the name to set
+        * @param aName the name to set
         */
-       public void setName(String name) {
-               this.name = name;
+       public void setName(String aName) {
+               name = aName;
        }
 
        /**
@@ -104,10 +101,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the owner.
         *
-        * @param owner the owner to set
+        * @param anOwner the owner to set
         */
-       public void setOwner(String owner) {
-               this.owner = owner;
+       public void setOwner(String anOwner) {
+               owner = anOwner;
        }
 
        /**
@@ -122,10 +119,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the createdBy.
         *
-        * @param createdBy the createdBy to set
+        * @param aCreatedBy the createdBy to set
         */
-       public void setCreatedBy(String createdBy) {
-               this.createdBy = createdBy;
+       public void setCreatedBy(String aCreatedBy) {
+               createdBy = aCreatedBy;
        }
 
        /**
@@ -140,10 +137,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the modifiedBy.
         *
-        * @param modifiedBy the modifiedBy to set
+        * @param aModifiedBy the modifiedBy to set
         */
-       public void setModifiedBy(String modifiedBy) {
-               this.modifiedBy = modifiedBy;
+       public void setModifiedBy(String aModifiedBy) {
+               modifiedBy = aModifiedBy;
        }
 
        /**
@@ -158,10 +155,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the creationDate.
         *
-        * @param creationDate the creationDate to set
+        * @param aCreationDate the creationDate to set
         */
-       public void setCreationDate(Date creationDate) {
-               this.creationDate = creationDate;
+       public void setCreationDate(Date aCreationDate) {
+               creationDate = aCreationDate;
        }
 
        /**
@@ -176,10 +173,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the modificationDate.
         *
-        * @param modificationDate the modificationDate to set
+        * @param aModificationDate the modificationDate to set
         */
-       public void setModificationDate(Date modificationDate) {
-               this.modificationDate = modificationDate;
+       public void setModificationDate(Date aModificationDate) {
+               modificationDate = aModificationDate;
        }
 
        /**
@@ -194,10 +191,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the filePaths.
         *
-        * @param filePaths the filePaths to set
+        * @param newFilePaths the filePaths to set
         */
-       public void setFilePaths(List<String> filePaths) {
-               this.filePaths = filePaths;
+       public void setFilePaths(List<String> newFilePaths) {
+               filePaths = newFilePaths;
        }
 
        /**
@@ -212,10 +209,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the subfolderPaths.
         *
-        * @param subfolderPaths the subfolderPaths to set
+        * @param newSubfolderPaths the subfolderPaths to set
         */
-       public void setSubfolderPaths(List<String> subfolderPaths) {
-               this.subfolderPaths = subfolderPaths;
+       public void setSubfolderPaths(List<String> newSubfolderPaths) {
+               subfolderPaths = newSubfolderPaths;
        }
 
        /**
@@ -230,10 +227,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the permissions.
         *
-        * @param permissions the permissions to set
+        * @param newPermissions the permissions to set
         */
-       public void setPermissions(Set<PermissionHolder> permissions) {
-               this.permissions = permissions;
+       public void setPermissions(Set<PermissionHolder> newPermissions) {
+               permissions = newPermissions;
        }
 
        /**
@@ -248,10 +245,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the deleted.
         *
-        * @param deleted the deleted to set
+        * @param newDeleted the deleted to set
         */
-       public void setDeleted(boolean deleted) {
-               this.deleted = deleted;
+       public void setDeleted(boolean newDeleted) {
+               deleted = newDeleted;
        }
 
        public void removeSubfolderPath(String spath) {
@@ -275,10 +272,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the folders.
         *
-        * @param folders the folders to set
+        * @param newFolders the folders to set
         */
-       public void setFolders(List<FolderResource> folders) {
-               this.folders = folders;
+       public void setFolders(List<FolderResource> newFolders) {
+               folders = newFolders;
        }
 
        /**
@@ -293,10 +290,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the files.
         *
-        * @param files the files to set
+        * @param newFiles the files to set
         */
-       public void setFiles(List<FileResource> files) {
-               this.files = files;
+       public void setFiles(List<FileResource> newFiles) {
+               files = newFiles;
        }
 
        /**
@@ -311,17 +308,16 @@ public class FolderResource extends RestResource {
        /**
         * Modify the parentURI.
         *
-        * @param parentURI the parentURI to set
+        * @param aParentURI the parentURI to set
         */
-       public void setParentURI(String parentURI) {
-               this.parentURI = parentURI;
+       public void setParentURI(String aParentURI) {
+               parentURI = aParentURI;
        }
 
+       @Override
        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");
@@ -344,7 +340,6 @@ public class FolderResource extends RestResource {
                                                permission.setModifyACL(unmarshallBoolean(obj, "modifyACL"));
                                                permissions.add(permission);
                                        }
-
                                }
                }
                if (json.get("folders") != null) {
@@ -364,7 +359,6 @@ public class FolderResource extends RestResource {
                                                        folders.add(sub);
                                                        subfolderPaths.add(subUri);
                                                }
-
                                        }
                                }
                }
@@ -376,6 +370,7 @@ public class FolderResource extends RestResource {
                                        if (fo != null) {
                                                String fname = unmarshallString(fo, "name");
                                                String fowner = unmarshallString(fo, "owner");
+                                               String fcontent = unmarshallString(fo, "content");
 
                                                Integer fversion = null;
                                                if (fo.get("version") != null)
@@ -397,6 +392,7 @@ public class FolderResource extends RestResource {
                                                fs.setContentLength(fsize);
                                                fs.setDeleted(fdeleted);
                                                fs.setCreationDate(fcreationDate);
+                                               fs.setContentType(fcontent);
                                                files.add(fs);
                                        }
                                }
@@ -405,7 +401,6 @@ public class FolderResource extends RestResource {
                        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() {
@@ -432,10 +427,10 @@ public class FolderResource extends RestResource {
        /**
         * Modify the needsExpanding.
         *
-        * @param needsExpanding the needsExpanding to set
+        * @param newNeedsExpanding the needsExpanding to set
         */
-       public void setNeedsExpanding(boolean needsExpanding) {
-               this.needsExpanding = needsExpanding;
+       public void setNeedsExpanding(boolean newNeedsExpanding) {
+               needsExpanding = newNeedsExpanding;
        }
 
 }
index 44258de..ba7db76 100644 (file)
@@ -30,11 +30,8 @@ import com.google.gwt.json.client.JSONParser;
  */
 public class GroupResource extends RestResource {
 
-       /**
-        * @param path
-        */
-       public GroupResource(String path) {
-               super(path);
+       public GroupResource(String aPath) {
+               super(aPath);
        }
 
        List<String> userPaths = new ArrayList<String>();
@@ -51,19 +48,19 @@ public class GroupResource extends RestResource {
        /**
         * Modify the userPaths.
         *
-        * @param userPaths the userPaths to set
+        * @param usernewUaths the userPaths to set
         */
-       public void setUserPaths(List<String> userPaths) {
-               this.userPaths = userPaths;
+       public void setUserPaths(List<String> usernewUaths) {
+               userPaths = usernewUaths;
        }
 
+       @Override
        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() {
index 2c535ec..48e5cd7 100644 (file)
@@ -27,19 +27,15 @@ import com.google.gwt.json.client.JSONParser;
  *
  */
 public class GroupUserResource extends RestResource{
-       /**
-        * @param path
-        */
-       public GroupUserResource(String path) {
-               super(path);
+
+       public GroupUserResource(String aPath) {
+               super(aPath);
        }
 
        String username;
        String name;
        String home;
 
-
-
        /**
         * Retrieve the username.
         *
@@ -52,10 +48,10 @@ public class GroupUserResource extends RestResource{
        /**
         * Modify the username.
         *
-        * @param username the username to set
+        * @param aUsername the username to set
         */
-       public void setUsername(String username) {
-               this.username = username;
+       public void setUsername(String aUsername) {
+               username = aUsername;
        }
 
        /**
@@ -70,10 +66,10 @@ public class GroupUserResource extends RestResource{
        /**
         * Modify the name.
         *
-        * @param name the name to set
+        * @param aName the name to set
         */
-       public void setName(String name) {
-               this.name = name;
+       public void setName(String aName) {
+               name = aName;
        }
 
        /**
@@ -88,12 +84,13 @@ public class GroupUserResource extends RestResource{
        /**
         * Modify the home.
         *
-        * @param home the home to set
+        * @param aHome the home to set
         */
-       public void setHome(String home) {
-               this.home = home;
+       public void setHome(String aHome) {
+               home = aHome;
        }
 
+       @Override
        public void createFromJSON(String text) {
                JSONObject json = (JSONObject) JSONParser.parse(text);
                name = unmarshallString(json, "name");
index 6c4ab41..4c18399 100644 (file)
@@ -30,11 +30,8 @@ import com.google.gwt.json.client.JSONParser;
  */
 public class GroupsResource extends RestResource {
 
-       /**
-        * @param path
-        */
-       public GroupsResource(String path) {
-               super(path);
+       public GroupsResource(String aPath) {
+               super(aPath);
        }
 
        List<String> groupPaths = new ArrayList<String>();
@@ -51,12 +48,13 @@ public class GroupsResource extends RestResource {
        /**
         * Modify the groupPaths.
         *
-        * @param groupPaths the groupPaths to set
+        * @param newGroupPaths the groupPaths to set
         */
-       public void setGroupPaths(List<String> groupPaths) {
-               this.groupPaths = groupPaths;
+       public void setGroupPaths(List<String> newGroupPaths) {
+               groupPaths = newGroupPaths;
        }
 
+       @Override
        public void createFromJSON(String text) {
                JSONArray array = (JSONArray) JSONParser.parse(text);
                if (array != null)
@@ -68,7 +66,6 @@ public class GroupsResource extends RestResource {
                                                getGroupPaths().add(uri);
                                }
                        }
-
        }
 
 }
index 5c1c63f..d58bde0 100644 (file)
@@ -33,24 +33,16 @@ import com.google.gwt.json.client.JSONParser;
  *
  */
 public class OtherUserResource extends RestResource{
-       /**
-        * @param path
-        */
-       public OtherUserResource(String path) {
-               super(path);
+       public OtherUserResource(String aPath) {
+               super(aPath);
        }
-       String username;
-
 
+       String username;
        List<String> filePaths = new LinkedList<String>();
        List<String> subfolderPaths = new LinkedList<String>();
        List<FolderResource> folders = new ArrayList<FolderResource>();
-
        List<FileResource> files = new ArrayList<FileResource>();
 
-
-
-
        /**
         * Retrieve the username.
         *
@@ -64,10 +56,10 @@ public class OtherUserResource extends RestResource{
        /**
         * Modify the username.
         *
-        * @param username the username to set
+        * @param aUsername the username to set
         */
-       public void setUsername(String username) {
-               this.username = username;
+       public void setUsername(String aUsername) {
+               username = aUsername;
        }
 
        /**
@@ -82,10 +74,10 @@ public class OtherUserResource extends RestResource{
        /**
         * Modify the files.
         *
-        * @param files the files to set
+        * @param newFiles the files to set
         */
-       public void setFilePaths(List<String> files) {
-               filePaths = files;
+       public void setFilePaths(List<String> newFiles) {
+               filePaths = newFiles;
        }
 
        /**
@@ -106,7 +98,6 @@ public class OtherUserResource extends RestResource{
                subfolderPaths = subfolders;
        }
 
-
        /**
         * Retrieve the folders.
         *
@@ -116,17 +107,15 @@ public class OtherUserResource extends RestResource{
                return folders;
        }
 
-
        /**
         * Modify the folders.
         *
-        * @param folders the folders to set
+        * @param newFolders the folders to set
         */
-       public void setFolders(List<FolderResource> folders) {
-               this.folders = folders;
+       public void setFolders(List<FolderResource> newFolders) {
+               folders = newFolders;
        }
 
-
        /**
         * Retrieve the files.
         *
@@ -136,16 +125,16 @@ public class OtherUserResource extends RestResource{
                return files;
        }
 
-
        /**
         * Modify the files.
         *
-        * @param files the files to set
+        * @param newFiles the files to set
         */
-       public void setFiles(List<FileResource> files) {
-               this.files = files;
+       public void setFiles(List<FileResource> newFiles) {
+               files = newFiles;
        }
 
+       @Override
        public void createFromJSON(String text) {
                JSONObject json = (JSONObject) JSONParser.parse(text);
                if (json.get("folders") != null) {
@@ -165,7 +154,6 @@ public class OtherUserResource extends RestResource{
                                                        folders.add(sub);
                                                        subfolderPaths.add(subUri);
                                                }
-
                                        }
                                }
                }
@@ -177,7 +165,7 @@ public class OtherUserResource extends RestResource{
                                        if (fo != null) {
                                                String fname = unmarshallString(fo, "name");
                                                String fowner = unmarshallString(fo, "owner");
-                                               String fvs = unmarshallString(fo, "version");
+                                               String fcontent = unmarshallString(fo, "content");
                                                Integer fversion = null;
                                                if (fo.get("version") != null)
                                                        fversion = new Integer(fo.get("version").toString());
@@ -197,11 +185,11 @@ public class OtherUserResource extends RestResource{
                                                fs.setContentLength(fsize);
                                                fs.setDeleted(fdeleted);
                                                fs.setCreationDate(fcreationDate);
+                                               fs.setContentType(fcontent);
                                                files.add(fs);
                                        }
                                }
                }
-
        }
 
        public String getName(){
index dc29a36..4f844b9 100644 (file)
@@ -30,11 +30,8 @@ import com.google.gwt.json.client.JSONParser;
  */
 public class OthersResource extends RestResource {
 
-       /**
-        * @param path
-        */
-       public OthersResource(String path) {
-               super(path);
+       public OthersResource(String aPath) {
+               super(aPath);
        }
 
        List<String> others = new ArrayList<String>();
@@ -51,12 +48,13 @@ public class OthersResource extends RestResource {
        /**
         * Modify the others.
         *
-        * @param others the others to set
+        * @param newOthers the others to set
         */
-       public void setOthers(List<String> others) {
-               this.others = others;
+       public void setOthers(List<String> newOthers) {
+               others = newOthers;
        }
 
+       @Override
        public void createFromJSON(String text) {
                JSONArray array = (JSONArray) JSONParser.parse(text);
                if (array != null)
@@ -68,6 +66,5 @@ public class OthersResource extends RestResource {
                                                getOthers().add(uri);
                                }
                        }
-
        }
 }
index 7b1c06f..f7233de 100644 (file)
@@ -45,10 +45,10 @@ public class PermissionHolder implements Serializable{
        /**
         * Modify the user.
         *
-        * @param user the user to set
+        * @param aUser the user to set
         */
-       public void setUser(String user) {
-               this.user = user;
+       public void setUser(String aUser) {
+               user = aUser;
        }
 
        /**
@@ -63,10 +63,10 @@ public class PermissionHolder implements Serializable{
        /**
         * Modify the group.
         *
-        * @param group the group to set
+        * @param aGroup the group to set
         */
-       public void setGroup(String group) {
-               this.group = group;
+       public void setGroup(String aGroup) {
+               group = aGroup;
        }
 
        /**
@@ -81,10 +81,10 @@ public class PermissionHolder implements Serializable{
        /**
         * Modify the read.
         *
-        * @param read the read to set
+        * @param aRead the read to set
         */
-       public void setRead(boolean read) {
-               this.read = read;
+       public void setRead(boolean aRead) {
+               read = aRead;
        }
 
        /**
@@ -99,10 +99,10 @@ public class PermissionHolder implements Serializable{
        /**
         * Modify the write.
         *
-        * @param write the write to set
+        * @param aWrite the write to set
         */
-       public void setWrite(boolean write) {
-               this.write = write;
+       public void setWrite(boolean aWrite) {
+               write = aWrite;
        }
 
        /**
@@ -117,12 +117,10 @@ public class PermissionHolder implements Serializable{
        /**
         * Modify the modifyACL.
         *
-        * @param modifyACL the modifyACL to set
+        * @param aModifyACL the modifyACL to set
         */
-       public void setModifyACL(boolean modifyACL) {
-               this.modifyACL = modifyACL;
+       public void setModifyACL(boolean aModifyACL) {
+               modifyACL = aModifyACL;
        }
 
-
-
 }
index 129f7aa..f29fceb 100644 (file)
@@ -44,10 +44,10 @@ public class QuotaHolder implements Serializable{
        /**
         * Modify the fileCount.
         *
-        * @param fileCount the fileCount to set
+        * @param aFileCount the fileCount to set
         */
-       public void setFileCount(Long fileCount) {
-               this.fileCount = fileCount;
+       public void setFileCount(Long aFileCount) {
+               fileCount = aFileCount;
        }
 
        /**
@@ -62,10 +62,10 @@ public class QuotaHolder implements Serializable{
        /**
         * Modify the fileSize.
         *
-        * @param fileSize the fileSize to set
+        * @param aFileSize the fileSize to set
         */
-       public void setFileSize(Long fileSize) {
-               this.fileSize = fileSize;
+       public void setFileSize(Long aFileSize) {
+               fileSize = aFileSize;
        }
 
        /**
@@ -80,11 +80,12 @@ public class QuotaHolder implements Serializable{
        /**
         * Modify the quotaLeftSize.
         *
-        * @param quotaLeftSize the quotaLeftSize to set
+        * @param aQuotaLeftSize the quotaLeftSize to set
         */
-       public void setQuotaLeftSize(Long quotaLeftSize) {
-               this.quotaLeftSize = quotaLeftSize;
+       public void setQuotaLeftSize(Long aQuotaLeftSize) {
+               quotaLeftSize = aQuotaLeftSize;
        }
+
        public String getFileSizeAsString() {
                if (fileSize < 1024)
                        return String.valueOf(fileSize) + " B";
index 38077e2..4e01150 100644 (file)
@@ -30,18 +30,11 @@ import com.google.gwt.json.client.JSONObject;
 public abstract class RestResource implements Serializable{
        String path;
 
-
-       /**
-        * @param path
-        */
-       public RestResource(String path) {
+       public RestResource(String aPath) {
                super();
-               this.path = path;
+               path = aPath;
        }
 
-
-
-
        /**
         * Retrieve the path.
         *
@@ -51,23 +44,17 @@ public abstract class RestResource implements Serializable{
                return path;
        }
 
-
-
-
        /**
         * Modify the path.
         *
-        * @param path the path to set
+        * @param aPath the path to set
         */
-       public void setPath(String path) {
-               this.path = path;
+       public void setPath(String aPath) {
+               path = aPath;
        }
 
-
-
        public abstract void createFromJSON(String text);
 
-
        protected String unmarshallString(JSONObject obj, String varName){
                if(obj.get(varName) != null)
                        if(obj.get(varName).isString() != null)
index faadfae..bfc01f0 100644 (file)
@@ -32,11 +32,8 @@ import com.google.gwt.json.client.JSONParser;
  */
 public class SearchResource extends RestResource {
 
-       /**
-        * @param path
-        */
-       public SearchResource(String path) {
-               super(path);
+       public SearchResource(String aPath) {
+               super(aPath);
        }
 
        List<FileResource> files = new ArrayList<FileResource>();
@@ -54,10 +51,10 @@ public class SearchResource extends RestResource {
        /**
         * Modify the files.
         *
-        * @param filepaths the files to set
+        * @param newFilePaths the files to set
         */
-       public void setFilePaths(List<String> filePaths) {
-               this.filePaths = filePaths;
+       public void setFilePaths(List<String> newFilePaths) {
+               filePaths = newFilePaths;
        }
 
        /**
@@ -69,18 +66,17 @@ public class SearchResource extends RestResource {
                return files;
        }
 
-
        /**
         * Modify the files.
         *
-        * @param files the files to set
+        * @param newFiles the files to set
         */
-       public void setFiles(List<FileResource> files) {
-               this.files = files;
+       public void setFiles(List<FileResource> newFiles) {
+               files = newFiles;
        }
 
+       @Override
        public void createFromJSON(String text) {
-
                JSONArray subs = JSONParser.parse(text).isArray();
                if (subs != null)
                        for (int i = 0; i < subs.size(); i++) {
@@ -88,7 +84,7 @@ public class SearchResource extends RestResource {
                                if (fo != null) {
                                        String fname = unmarshallString(fo, "name");
                                        String fowner = unmarshallString(fo, "owner");
-                                       String fvs = unmarshallString(fo, "version");
+                                       String fcontent = unmarshallString(fo, "content");
                                        Integer fversion = null;
                                        if (fo.get("version") != null)
                                                fversion = new Integer(fo.get("version").toString());
@@ -108,6 +104,7 @@ public class SearchResource extends RestResource {
                                        fs.setContentLength(fsize);
                                        fs.setDeleted(fdeleted);
                                        fs.setCreationDate(fcreationDate);
+                                       fs.setContentType(fcontent);
                                        files.add(fs);
                                }
                        }
index 49c8dfb..16ce79e 100644 (file)
@@ -34,14 +34,10 @@ import com.google.gwt.json.client.JSONParser;
  */
 public class SharedResource extends RestResource{
 
-       /**
-        * @param path
-        */
-       public SharedResource(String path) {
-               super(path);
+       public SharedResource(String aPath) {
+               super(aPath);
        }
 
-
        List<String> filePaths = new LinkedList<String>();
        List<String> subfolderPaths = new LinkedList<String>();
        List<FolderResource> folders = new ArrayList<FolderResource>();
@@ -60,10 +56,10 @@ public class SharedResource extends RestResource{
        /**
         * Modify the files.
         *
-        * @param filepaths the files to set
+        * @param newFilePaths the files to set
         */
-       public void setFilePaths(List<String> filePaths) {
-               this.filePaths = filePaths;
+       public void setFilePaths(List<String> newFilePaths) {
+               filePaths = newFilePaths;
        }
 
        /**
@@ -76,15 +72,14 @@ public class SharedResource extends RestResource{
        }
 
        /**
-        * Modify the subfolders.
+        * Modify the subfolder paths.
         *
-        * @param subfolderPaths the subfolders to set
+        * @param newSubfolderPaths the subfolder paths to set
         */
-       public void setSubfolderPaths(List<String> subfolderPaths) {
-               this.subfolderPaths = subfolderPaths;
+       public void setSubfolderPaths(List<String> newSubfolderPaths) {
+               subfolderPaths = newSubfolderPaths;
        }
 
-
        /**
         * Retrieve the folders.
         *
@@ -94,17 +89,15 @@ public class SharedResource extends RestResource{
                return folders;
        }
 
-
        /**
         * Modify the folders.
         *
-        * @param folders the folders to set
+        * @param newFolders the folders to set
         */
-       public void setFolders(List<FolderResource> folders) {
-               this.folders = folders;
+       public void setFolders(List<FolderResource> newFolders) {
+               folders = newFolders;
        }
 
-
        /**
         * Retrieve the files.
         *
@@ -114,16 +107,16 @@ public class SharedResource extends RestResource{
                return files;
        }
 
-
        /**
         * Modify the files.
         *
-        * @param files the files to set
+        * @param newFiles the files to set
         */
-       public void setFiles(List<FileResource> files) {
-               this.files = files;
+       public void setFiles(List<FileResource> newFiles) {
+               files = newFiles;
        }
 
+       @Override
        public void createFromJSON(String text) {
                JSONObject json = (JSONObject) JSONParser.parse(text);
                if (json.get("folders") != null) {
@@ -143,7 +136,6 @@ public class SharedResource extends RestResource{
                                                        folders.add(sub);
                                                        subfolderPaths.add(subUri);
                                                }
-
                                        }
                                }
                }
@@ -155,7 +147,7 @@ public class SharedResource extends RestResource{
                                        if (fo != null) {
                                                String fname = unmarshallString(fo, "name");
                                                String fowner = unmarshallString(fo, "owner");
-                                               String fvs = unmarshallString(fo, "version");
+                                               String fcontent = unmarshallString(fo, "content");
                                                Integer fversion = null;
                                                if (fo.get("version") != null)
                                                        fversion = new Integer(fo.get("version").toString());
@@ -175,14 +167,13 @@ public class SharedResource extends RestResource{
                                                fs.setContentLength(fsize);
                                                fs.setDeleted(fdeleted);
                                                fs.setCreationDate(fcreationDate);
+                                               fs.setContentType(fcontent);
                                                files.add(fs);
                                        }
                                }
                }
-
        }
 
-
        public List<String> getRootSharedFiles(){
                List<String> res = new ArrayList<String>();
                for(String f : getFilePaths()){
index 3f1e6b7..84c03d5 100644 (file)
@@ -31,16 +31,12 @@ import com.google.gwt.json.client.JSONParser;
  */
 public class TagsResource extends RestResource{
 
-       /**
-        * @param path
-        */
-       public TagsResource(String path) {
-               super(path);
+       public TagsResource(String aPath) {
+               super(aPath);
        }
 
        List<String> tags = new ArrayList<String>();
 
-
        /**
         * Retrieve the tags.
         *
@@ -53,17 +49,17 @@ public class TagsResource extends RestResource{
        /**
         * Modify the tags.
         *
-        * @param tags the tags to set
+        * @param newTags the tags to set
         */
-       public void setTags(List<String> tags) {
-               this.tags = tags;
+       public void setTags(List<String> newTags) {
+               tags = newTags;
        }
 
+       @Override
        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());
-
        }
 }
index 720598d..f4c86e8 100644 (file)
@@ -35,11 +35,8 @@ import com.google.gwt.json.client.JSONParser;
  */
 public class TrashResource extends RestResource{
 
-       /**
-        * @param path
-        */
-       public TrashResource(String path) {
-               super(path);
+       public TrashResource(String aPath) {
+               super(aPath);
        }
 
        List<String> filePaths = new LinkedList<String>();
@@ -47,41 +44,40 @@ public class TrashResource extends RestResource{
        List<FolderResource> folders = new ArrayList<FolderResource>();
        List<FileResource> files = new ArrayList<FileResource>();
 
-
        /**
-        * Retrieve the files.
+        * Retrieve the file paths.
         *
-        * @return the files
+        * @return the file paths
         */
        public List<String> getFilePaths() {
                return filePaths;
        }
 
        /**
-        * Modify the files.
+        * Modify the file paths.
         *
-        * @param filePaths the files to set
+        * @param newFilePaths the file paths to set
         */
-       public void setFilePaths(List<String> filePaths) {
-               filePaths = filePaths;
+       public void setFilePaths(List<String> newFilePaths) {
+               filePaths = newFilePaths;
        }
 
        /**
-        * Retrieve the subfolders.
+        * Retrieve the subfolder paths.
         *
-        * @return the subfolders
+        * @return the subfolder paths
         */
        public List<String> getSubfolderPaths() {
                return subfolderPaths;
        }
 
        /**
-        * Modify the subfolders.
+        * Modify the subfolder paths.
         *
-        * @param subfolders the subfolders to set
+        * @param newSubfolderPaths the subfolders to set
         */
-       public void setSubfolderPaths(List<String> subfolderPaths) {
-               subfolderPaths = subfolderPaths;
+       public void setSubfolderPaths(List<String> newSubfolderPaths) {
+               subfolderPaths = newSubfolderPaths;
        }
 
 
@@ -98,10 +94,10 @@ public class TrashResource extends RestResource{
        /**
         * Modify the folders.
         *
-        * @param folders the folders to set
+        * @param newFolders the folders to set
         */
-       public void setFolders(List<FolderResource> folders) {
-               this.folders = folders;
+       public void setFolders(List<FolderResource> newFolders) {
+               folders = newFolders;
        }
 
 
@@ -118,12 +114,13 @@ public class TrashResource extends RestResource{
        /**
         * Modify the files.
         *
-        * @param files the files to set
+        * @param newFiles the files to set
         */
-       public void setFiles(List<FileResource> files) {
-               this.files = files;
+       public void setFiles(List<FileResource> newFiles) {
+               files = newFiles;
        }
 
+       @Override
        public void createFromJSON(String text) {
                JSONObject json = (JSONObject) JSONParser.parse(text);
                if (json.get("folders") != null) {
@@ -143,7 +140,6 @@ public class TrashResource extends RestResource{
                                                        folders.add(sub);
                                                        subfolderPaths.add(subUri);
                                                }
-
                                        }
                                }
                }
@@ -155,7 +151,7 @@ public class TrashResource extends RestResource{
                                        if (fo != null) {
                                                String fname = unmarshallString(fo, "name");
                                                String fowner = unmarshallString(fo, "owner");
-                                               String fvs = unmarshallString(fo, "version");
+                                               String fcontent = unmarshallString(fo, "content");
                                                Integer fversion = null;
                                                if (fo.get("version") != null)
                                                        fversion = new Integer(fo.get("version").toString());
@@ -175,6 +171,7 @@ public class TrashResource extends RestResource{
                                                fs.setContentLength(fsize);
                                                fs.setDeleted(fdeleted);
                                                fs.setCreationDate(fcreationDate);
+                                               fs.setContentType(fcontent);
                                                files.add(fs);
                                        }
                                }
index 48515e7..e399f34 100644 (file)
@@ -30,11 +30,8 @@ public class UploadStatusResource extends RestResource{
        long bytesTransferred;
        long fileSize;
 
-       /**
-        * @param path
-        */
-       public UploadStatusResource(String path) {
-               super(path);
+       public UploadStatusResource(String aPath) {
+               super(aPath);
        }
 
 
@@ -50,10 +47,10 @@ public class UploadStatusResource extends RestResource{
        /**
         * Modify the bytesTransferred.
         *
-        * @param bytesTransferred the bytesTransferred to set
+        * @param newBytesTransferred the bytesTransferred to set
         */
-       public void setBytesTransferred(long bytesTransferred) {
-               this.bytesTransferred = bytesTransferred;
+       public void setBytesTransferred(long newBytesTransferred) {
+               bytesTransferred = newBytesTransferred;
        }
 
        /**
@@ -68,14 +65,14 @@ public class UploadStatusResource extends RestResource{
        /**
         * Modify the fileSize.
         *
-        * @param fileSize the fileSize to set
+        * @param newFileSize the fileSize to set
         */
-       public void setFileSize(long fileSize) {
-               this.fileSize = fileSize;
+       public void setFileSize(long newFileSize) {
+               fileSize = newFileSize;
        }
 
        public int percent(){
-               return new Long(bytesTransferred*100/fileSize).intValue();
+               return new Long(bytesTransferred * 100 / fileSize).intValue();
        }
 
        @Override
index 9738148..2a90dcb 100644 (file)
@@ -28,11 +28,8 @@ import com.google.gwt.json.client.JSONParser;
  */
 public class UserResource extends RestResource {
 
-       /**
-        * @param path
-        */
-       public UserResource(String path) {
-               super(path);
+       public UserResource(String aPath) {
+               super(aPath);
        }
 
        private String name;
@@ -71,10 +68,10 @@ public class UserResource extends RestResource {
        /**
         * Modify the name.
         *
-        * @param name the name to set
+        * @param aName the name to set
         */
-       public void setName(String name) {
-               this.name = name;
+       public void setName(String aName) {
+               name = aName;
        }
 
        /**
@@ -89,10 +86,10 @@ public class UserResource extends RestResource {
        /**
         * Modify the username.
         *
-        * @param username the username to set
+        * @param aUsername the username to set
         */
-       public void setUsername(String username) {
-               this.username = username;
+       public void setUsername(String aUsername) {
+               username = aUsername;
        }
 
        /**
@@ -107,10 +104,10 @@ public class UserResource extends RestResource {
        /**
         * Modify the email.
         *
-        * @param email the email to set
+        * @param anEmail the email to set
         */
-       public void setEmail(String email) {
-               this.email = email;
+       public void setEmail(String anEmail) {
+               email = anEmail;
        }
 
        /**
@@ -125,10 +122,10 @@ public class UserResource extends RestResource {
        /**
         * Modify the creationDate.
         *
-        * @param creationDate the creationDate to set
+        * @param aCreationDate the creationDate to set
         */
-       public void setCreationDate(Date creationDate) {
-               this.creationDate = creationDate;
+       public void setCreationDate(Date aCreationDate) {
+               creationDate = aCreationDate;
        }
 
        /**
@@ -143,10 +140,10 @@ public class UserResource extends RestResource {
        /**
         * Modify the modificationDate.
         *
-        * @param modificationDate the modificationDate to set
+        * @param aModificationDate the modificationDate to set
         */
-       public void setModificationDate(Date modificationDate) {
-               this.modificationDate = modificationDate;
+       public void setModificationDate(Date aModificationDate) {
+               modificationDate = aModificationDate;
        }
 
        /**
@@ -161,10 +158,10 @@ public class UserResource extends RestResource {
        /**
         * Modify the filesPath.
         *
-        * @param filesPath the filesPath to set
+        * @param aFilesPath the filesPath to set
         */
-       public void setFilesPath(String filesPath) {
-               this.filesPath = filesPath;
+       public void setFilesPath(String aFilesPath) {
+               filesPath = aFilesPath;
        }
 
        /**
@@ -179,10 +176,10 @@ public class UserResource extends RestResource {
        /**
         * Modify the trashPath.
         *
-        * @param trashPath the trashPath to set
+        * @param aTrashPath the trashPath to set
         */
-       public void setTrashPath(String trashPath) {
-               this.trashPath = trashPath;
+       public void setTrashPath(String aTrashPath) {
+               trashPath = aTrashPath;
        }
 
        /**
@@ -197,10 +194,10 @@ public class UserResource extends RestResource {
        /**
         * Modify the sharedPath.
         *
-        * @param sharedPath the sharedPath to set
+        * @param aSharedPath the sharedPath to set
         */
-       public void setSharedPath(String sharedPath) {
-               this.sharedPath = sharedPath;
+       public void setSharedPath(String aSharedPath) {
+               sharedPath = aSharedPath;
        }
 
        /**
@@ -215,10 +212,10 @@ public class UserResource extends RestResource {
        /**
         * Modify the othersPath.
         *
-        * @param othersPath the othersPath to set
+        * @param anOthersPath the othersPath to set
         */
-       public void setOthersPath(String othersPath) {
-               this.othersPath = othersPath;
+       public void setOthersPath(String anOthersPath) {
+               othersPath = anOthersPath;
        }
 
        /**
@@ -233,10 +230,10 @@ public class UserResource extends RestResource {
        /**
         * Modify the tagsPath.
         *
-        * @param tagsPath the tagsPath to set
+        * @param aTagsPath the tagsPath to set
         */
-       public void setTagsPath(String tagsPath) {
-               this.tagsPath = tagsPath;
+       public void setTagsPath(String aTagsPath) {
+               tagsPath = aTagsPath;
        }
 
        /**
@@ -251,10 +248,10 @@ public class UserResource extends RestResource {
        /**
         * Modify the groupsPath.
         *
-        * @param groupsPath the groupsPath to set
+        * @param aGroupsPath the groupsPath to set
         */
-       public void setGroupsPath(String groupsPath) {
-               this.groupsPath = groupsPath;
+       public void setGroupsPath(String aGroupsPath) {
+               groupsPath = aGroupsPath;
        }
 
        /**
@@ -269,12 +266,13 @@ public class UserResource extends RestResource {
        /**
         * Modify the quota.
         *
-        * @param quota the quota to set
+        * @param aQuota the quota to set
         */
-       public void setQuota(QuotaHolder quota) {
-               this.quota = quota;
+       public void setQuota(QuotaHolder aQuota) {
+               quota = aQuota;
        }
 
+       @Override
        public void createFromJSON(String text) {
                JSONObject json = (JSONObject) JSONParser.parse(text);
                email = unmarshallString(json, "email");
@@ -302,9 +300,9 @@ public class UserResource extends RestResource {
                                        quota.setQuotaLeftSize(new Long(qj.get("bytesRemaining").toString()));
                        }
                }
-
        }
 
+       @Override
        public String toString() {
                String res = email + "\n" + name + "\n" + username + "\n" + filesPath + "\n" + groupsPath;
                return res;
index b09e959..fa81f50 100644 (file)
@@ -32,9 +32,6 @@ import com.google.gwt.json.client.JSONParser;
  */
 public class UserSearchResource extends RestResource {
 
-       /**
-        * @param aPath
-        */
        public UserSearchResource(String aPath) {
                super(aPath);
        }
diff --git a/gss/src/gr/ebs/gss/resources/mimetypes/acroread.png b/gss/src/gr/ebs/gss/resources/mimetypes/acroread.png
new file mode 100644 (file)
index 0000000..a0e057f
Binary files /dev/null and b/gss/src/gr/ebs/gss/resources/mimetypes/acroread.png differ
diff --git a/gss/src/gr/ebs/gss/resources/mimetypes/ark2.png b/gss/src/gr/ebs/gss/resources/mimetypes/ark2.png
new file mode 100644 (file)
index 0000000..e4aa214
Binary files /dev/null and b/gss/src/gr/ebs/gss/resources/mimetypes/ark2.png differ
diff --git a/gss/src/gr/ebs/gss/resources/mimetypes/document_menu.png b/gss/src/gr/ebs/gss/resources/mimetypes/document_menu.png
deleted file mode 100644 (file)
index 56aeffa..0000000
Binary files a/gss/src/gr/ebs/gss/resources/mimetypes/document_menu.png and /dev/null differ
diff --git a/gss/src/gr/ebs/gss/resources/mimetypes/html.png b/gss/src/gr/ebs/gss/resources/mimetypes/html.png
new file mode 100644 (file)
index 0000000..2a0e4b3
Binary files /dev/null and b/gss/src/gr/ebs/gss/resources/mimetypes/html.png differ
diff --git a/gss/src/gr/ebs/gss/resources/mimetypes/java.png b/gss/src/gr/ebs/gss/resources/mimetypes/java.png
deleted file mode 100644 (file)
index 49b5b6d..0000000
Binary files a/gss/src/gr/ebs/gss/resources/mimetypes/java.png and /dev/null differ
diff --git a/gss/src/gr/ebs/gss/resources/mimetypes/kcmfontinst.png b/gss/src/gr/ebs/gss/resources/mimetypes/kcmfontinst.png
new file mode 100644 (file)
index 0000000..267a732
Binary files /dev/null and b/gss/src/gr/ebs/gss/resources/mimetypes/kcmfontinst.png differ
diff --git a/gss/src/gr/ebs/gss/resources/mimetypes/knotify.png b/gss/src/gr/ebs/gss/resources/mimetypes/knotify.png
new file mode 100644 (file)
index 0000000..c4e85b4
Binary files /dev/null and b/gss/src/gr/ebs/gss/resources/mimetypes/knotify.png differ
diff --git a/gss/src/gr/ebs/gss/resources/mimetypes/kpresenter_kpr.png b/gss/src/gr/ebs/gss/resources/mimetypes/kpresenter_kpr.png
new file mode 100644 (file)
index 0000000..9b9a483
Binary files /dev/null and b/gss/src/gr/ebs/gss/resources/mimetypes/kpresenter_kpr.png differ
diff --git a/gss/src/gr/ebs/gss/resources/mimetypes/log.png b/gss/src/gr/ebs/gss/resources/mimetypes/log.png
new file mode 100644 (file)
index 0000000..90928f5
Binary files /dev/null and b/gss/src/gr/ebs/gss/resources/mimetypes/log.png differ
diff --git a/gss/src/gr/ebs/gss/resources/mimetypes/source_c.png b/gss/src/gr/ebs/gss/resources/mimetypes/source_c.png
deleted file mode 100644 (file)
index 8312c6b..0000000
Binary files a/gss/src/gr/ebs/gss/resources/mimetypes/source_c.png and /dev/null differ
diff --git a/gss/src/gr/ebs/gss/resources/mimetypes/video2.png b/gss/src/gr/ebs/gss/resources/mimetypes/video2.png
new file mode 100644 (file)
index 0000000..0a26d45
Binary files /dev/null and b/gss/src/gr/ebs/gss/resources/mimetypes/video2.png differ
index 1de93fe..0412c53 100644 (file)
@@ -1615,6 +1615,7 @@ public class FilesHandler extends RequestHandler {
                                        put("owner", f.getOwner().getUsername()).
                                        put("deleted", f.isDeleted()).
                                        put("version", f.getVersion()).
+                                       put("content", f.getMimeType()).
                                        put("size", f.getFileSize()).
                                        put("creationDate", f.getAuditInfo().getCreationDate().getTime()).
                                        put("uri", folderUrl + URLEncoder.encode(f.getName(), "UTF-8"));
@@ -1673,12 +1674,14 @@ public class FilesHandler extends RequestHandler {
                                                put("creationDate", oldBody.getAuditInfo().getCreationDate().getTime()).
                                                put("modifiedBy", oldBody.getAuditInfo().getModifiedBy().getUsername()).
                                                put("modificationDate", oldBody.getAuditInfo().getModificationDate().getTime()).
+                                               put("content", oldBody.getMimeType()).
                                                put("size", oldBody.getFileSize());
                        else
                                json.put("createdBy", file.getAuditInfo().getCreatedBy().getUsername()).
                                                put("creationDate", file.getAuditInfo().getCreationDate().getTime()).
                                                put("modifiedBy", file.getAuditInfo().getModifiedBy().getUsername()).
                                                put("modificationDate", file.getAuditInfo().getModificationDate().getTime()).
+                                               put("content", file.getMimeType()).
                                                put("size", file.getFileSize());
                Set<PermissionDTO> perms = getService().getFilePermissions(user.getId(), file.getId());
                json.put("permissions", renderJson(perms));
index a867873..a709a5f 100644 (file)
@@ -132,6 +132,7 @@ public class OthersHandler extends RequestHandler {
                                        put("deleted", f.isDeleted()).
                                        put("version", f.getVersion()).
                                        put("size", f.getFileSize()).
+                                       put("content", f.getMimeType()).
                                        put("creationDate", f.getAuditInfo().getCreationDate().getTime()).
                                        put("uri", parentUrl + f.getPath());
                                files.add(j);
index a48ef31..0e0cd15 100644 (file)
@@ -99,6 +99,7 @@ public class SharedHandler extends RequestHandler {
                                        put("deleted", f.isDeleted()).
                                        put("version", f.getVersion()).
                                        put("size", f.getFileSize()).
+                                       put("content", f.getMimeType()).
                                        put("folder", f.getFolder().getURI()).
                                        put("creationDate", f.getAuditInfo().getCreationDate().getTime()).
                                        put("uri", parentUrl + f.getPath());
index 6dea250..29f92d7 100644 (file)
@@ -119,6 +119,7 @@ public class TrashHandler extends RequestHandler {
                                        put("deleted", f.isDeleted()).
                                        put("version", f.getVersion()).
                                        put("size", f.getFileSize()).
+                                       put("content", f.getMimeType()).
                                        put("folder", f.getFolder().getURI()).
                                        put("creationDate", f.getAuditInfo().getCreationDate().getTime()).
                                put("uri", parentUrl + f.getPath());