fix node open on hover when using dnd
[pithos] / src / gr / ebs / gss / client / FilePropertiesDialog.java
1 /*\r
2  * Copyright 2007, 2008, 2009, 2010 Electronic Business Systems Ltd.\r
3  *\r
4  * This file is part of GSS.\r
5  *\r
6  * GSS is free software: you can redistribute it and/or modify\r
7  * it under the terms of the GNU General Public License as published by\r
8  * the Free Software Foundation, either version 3 of the License, or\r
9  * (at your option) any later version.\r
10  *\r
11  * GSS is distributed in the hope that it will be useful,\r
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14  * GNU General Public License for more details.\r
15  *\r
16  * You should have received a copy of the GNU General Public License\r
17  * along with GSS.  If not, see <http://www.gnu.org/licenses/>.\r
18  */\r
19 package gr.ebs.gss.client;\r
20 \r
21 import gr.ebs.gss.client.rest.PostCommand;\r
22 import gr.ebs.gss.client.rest.RestException;\r
23 import gr.ebs.gss.client.rest.resource.FileResource;\r
24 import gr.ebs.gss.client.rest.resource.GroupResource;\r
25 import gr.ebs.gss.client.rest.resource.PermissionHolder;\r
26 \r
27 import java.util.Iterator;\r
28 import java.util.List;\r
29 import java.util.Set;\r
30 \r
31 import com.google.gwt.core.client.GWT;\r
32 import com.google.gwt.event.dom.client.ChangeEvent;\r
33 import com.google.gwt.event.dom.client.ChangeHandler;\r
34 import com.google.gwt.event.dom.client.ClickEvent;\r
35 import com.google.gwt.event.dom.client.ClickHandler;\r
36 import com.google.gwt.event.dom.client.KeyDownEvent;\r
37 import com.google.gwt.event.dom.client.KeyDownHandler;\r
38 import com.google.gwt.i18n.client.DateTimeFormat;\r
39 import com.google.gwt.json.client.JSONArray;\r
40 import com.google.gwt.json.client.JSONBoolean;\r
41 import com.google.gwt.json.client.JSONObject;\r
42 import com.google.gwt.json.client.JSONString;\r
43 import com.google.gwt.resources.client.ClientBundle;\r
44 import com.google.gwt.resources.client.ImageResource;\r
45 import com.google.gwt.user.client.Command;\r
46 import com.google.gwt.user.client.DeferredCommand;\r
47 import com.google.gwt.user.client.ui.AbstractImagePrototype;\r
48 import com.google.gwt.user.client.ui.Button;\r
49 import com.google.gwt.user.client.ui.CheckBox;\r
50 import com.google.gwt.user.client.ui.DecoratedTabPanel;\r
51 import com.google.gwt.user.client.ui.DisclosurePanel;\r
52 import com.google.gwt.user.client.ui.FlexTable;\r
53 import com.google.gwt.user.client.ui.FlowPanel;\r
54 import com.google.gwt.user.client.ui.FocusPanel;\r
55 import com.google.gwt.user.client.ui.HTML;\r
56 import com.google.gwt.user.client.ui.HasHorizontalAlignment;\r
57 import com.google.gwt.user.client.ui.HorizontalPanel;\r
58 import com.google.gwt.user.client.ui.Label;\r
59 import com.google.gwt.user.client.ui.TextBox;\r
60 import com.google.gwt.user.client.ui.VerticalPanel;\r
61 \r
62 /**\r
63  * The 'File properties' dialog box implementation.\r
64  *\r
65  * @author past\r
66  */\r
67 public class FilePropertiesDialog extends AbstractPropertiesDialog {\r
68 \r
69         final PermissionsList permList;\r
70 \r
71         private CheckBox readForAll;\r
72 \r
73         /**\r
74          * An image bundle for this widgets images.\r
75          */\r
76         public interface Images extends ClientBundle,MessagePanel.Images {\r
77 \r
78                 @Source("gr/ebs/gss/resources/edit_user.png")\r
79                 ImageResource permUser();\r
80 \r
81                 @Source("gr/ebs/gss/resources/groupevent.png")\r
82                 ImageResource permGroup();\r
83 \r
84                 @Source("gr/ebs/gss/resources/editdelete.png")\r
85                 ImageResource delete();\r
86 \r
87                 @Source("gr/ebs/gss/resources/db_update.png")\r
88                 ImageResource restore();\r
89 \r
90                 @Source("gr/ebs/gss/resources/folder_inbox.png")\r
91                 ImageResource download();\r
92         }\r
93 \r
94         /**\r
95          * The widget that holds the name of the file.\r
96          */\r
97         private TextBox name = new TextBox();\r
98 \r
99         private final CheckBox versioned = new CheckBox();\r
100 \r
101         final FileResource file;\r
102 \r
103         private String userFullName;\r
104 \r
105         /**\r
106          * The widget's constructor.\r
107          *\r
108          * @param images the dialog's ImageBundle\r
109          * @param groups\r
110          * @param bodies\r
111          */\r
112         public FilePropertiesDialog(final Images images, final List<GroupResource> groups, List<FileResource> bodies, String _userFullName) {\r
113 \r
114                 // Set the dialog's caption.\r
115                 setText("File properties");\r
116 \r
117                 file = (FileResource) GSS.get().getCurrentSelection();\r
118                 userFullName = _userFullName;\r
119                 permList = new PermissionsList(images, file.getPermissions(), file.getOwner());\r
120 \r
121 \r
122                 // Outer contains inner and buttons.\r
123                 final VerticalPanel outer = new VerticalPanel();\r
124                 final FocusPanel focusPanel = new FocusPanel(outer);\r
125                 // Inner contains generalPanel and permPanel.\r
126                 inner = new DecoratedTabPanel();\r
127                 inner.setAnimationEnabled(true);\r
128                 final VerticalPanel generalPanel = new VerticalPanel();\r
129                 final VerticalPanel permPanel = new VerticalPanel();\r
130                 final HorizontalPanel buttons = new HorizontalPanel();\r
131                 final HorizontalPanel permButtons = new HorizontalPanel();\r
132                 final HorizontalPanel permForAll = new HorizontalPanel();\r
133                 final HorizontalPanel pathPanel = new HorizontalPanel();\r
134                 final VerticalPanel verPanel = new VerticalPanel();\r
135                 final HorizontalPanel vPanel = new HorizontalPanel();\r
136                 final HorizontalPanel vPanel2 = new HorizontalPanel();\r
137 \r
138                 versioned.setValue(file.isVersioned());\r
139                 versioned.getElement().setId("filePropertiesDialog.chechBox.versioned");\r
140                 inner.add(generalPanel, "General");\r
141                 inner.add(permPanel, "Sharing");\r
142                 inner.add(verPanel, "Versions");\r
143                 inner.selectTab(0);\r
144 \r
145                 final Label fileNameNote = new Label("Please note that slashes ('/') are not allowed in file names.", true);\r
146                 fileNameNote.setVisible(false);\r
147                 fileNameNote.setStylePrimaryName("gss-readForAllNote");\r
148 \r
149                 final FlexTable generalTable = new FlexTable();\r
150                 generalTable.setText(0, 0, "Name");\r
151                 generalTable.setText(1, 0, "Folder");\r
152                 generalTable.setText(2, 0, "Owner");\r
153                 generalTable.setText(3, 0, "Last modified");\r
154                 generalTable.setText(4, 0, "Tags");\r
155                 name.setWidth("100%");\r
156                 name.setText(file.getName());\r
157                 name.getElement().setId("filePropertiesDialog.textBox.name");\r
158                 generalTable.setWidget(0, 1, name);\r
159                 name.addChangeHandler(new ChangeHandler() {\r
160 \r
161                         @Override\r
162                         public void onChange(ChangeEvent event) {\r
163                                 if(name.getText().contains("/"))\r
164                                         fileNameNote.setVisible(true);\r
165                                 else\r
166                                         fileNameNote.setVisible(false);\r
167 \r
168                         }\r
169                 });\r
170 \r
171                 if(file.getFolderName() != null)\r
172                         generalTable.setText(1, 1, file.getFolderName());\r
173                 else\r
174                         generalTable.setText(1, 1, "-");\r
175                 generalTable.setWidget(0, 2, fileNameNote);\r
176                 generalTable.setText(2, 1,userFullName);\r
177 \r
178                 final DateTimeFormat formatter = DateTimeFormat.getFormat("d/M/yyyy h:mm a");\r
179                 generalTable.setText(3, 1, formatter.format(file.getModificationDate()));\r
180                 // Get the tags.\r
181                 StringBuffer tagsBuffer = new StringBuffer();\r
182                 Iterator i = file.getTags().iterator();\r
183                 while (i.hasNext()) {\r
184                         String tag = (String) i.next();\r
185                         tagsBuffer.append(tag).append(", ");\r
186                 }\r
187                 if (tagsBuffer.length() > 1)\r
188                         tagsBuffer.delete(tagsBuffer.length() - 2, tagsBuffer.length() - 1);\r
189                 initialTagText = tagsBuffer.toString();\r
190                 tags.setWidth("100%");\r
191                 tags.getElement().setId("filePropertiesDialog.textBox.tags");\r
192                 tags.setText(initialTagText);\r
193                 generalTable.setWidget(4, 1, tags);\r
194                 generalTable.getFlexCellFormatter().setStyleName(0, 0, "props-labels");\r
195                 generalTable.getFlexCellFormatter().setStyleName(1, 0, "props-labels");\r
196                 generalTable.getFlexCellFormatter().setStyleName(2, 0, "props-labels");\r
197                 generalTable.getFlexCellFormatter().setStyleName(3, 0, "props-labels");\r
198                 generalTable.getFlexCellFormatter().setStyleName(4, 0, "props-labels");\r
199                 generalTable.getFlexCellFormatter().setStyleName(0, 1, "props-values");\r
200                 generalTable.getFlexCellFormatter().setStyleName(1, 1, "props-values");\r
201                 generalTable.getFlexCellFormatter().setStyleName(2, 1, "props-values");\r
202                 generalTable.getFlexCellFormatter().setStyleName(3, 1, "props-values");\r
203                 generalTable.getFlexCellFormatter().setStyleName(4, 1, "props-values");\r
204                 generalTable.setCellSpacing(4);\r
205 \r
206                 // Create the 'OK' button, along with a listener that hides the dialog\r
207                 // when the button is clicked.\r
208                 final Button ok = new Button("OK", new ClickHandler() {\r
209                         @Override\r
210                         public void onClick(ClickEvent event) {\r
211                                 if(name.getText().contains("/"))\r
212                                         fileNameNote.setVisible(true);\r
213                                 else{\r
214                                         fileNameNote.setVisible(true);\r
215                                         accept();\r
216                                         closeDialog();\r
217                                 }               \r
218                         }\r
219                 });\r
220                 ok.getElement().setId("filePropertiesDialog.button.ok");                \r
221                 buttons.add(ok);\r
222                 buttons.setCellHorizontalAlignment(ok, HasHorizontalAlignment.ALIGN_CENTER);\r
223                 // Create the 'Cancel' button, along with a listener that hides the\r
224                 // dialog when the button is clicked.\r
225                 final Button cancel = new Button("Cancel", new ClickHandler() {\r
226                         @Override\r
227                         public void onClick(ClickEvent event) {\r
228                                 closeDialog();\r
229                         }\r
230                 });\r
231                 cancel.getElement().setId("filePropertiesDialog.button.cancel");\r
232                 buttons.add(cancel);\r
233                 buttons.setCellHorizontalAlignment(cancel, HasHorizontalAlignment.ALIGN_CENTER);\r
234                 buttons.setSpacing(8);\r
235                 buttons.addStyleName("gss-TabPanelBottom");\r
236 \r
237                 generalPanel.add(generalTable);\r
238 \r
239                 // Asynchronously retrieve the tags defined by this user.\r
240                 DeferredCommand.addCommand(new Command() {\r
241 \r
242                         @Override\r
243                         public void execute() {\r
244                                 updateTags();\r
245                         }\r
246                 });\r
247 \r
248                 DisclosurePanel allTags = new DisclosurePanel("All tags");\r
249                 allTagsContent = new FlowPanel();\r
250                 allTagsContent.setWidth("100%");\r
251                 allTags.setContent(allTagsContent);\r
252                 generalPanel.add(allTags);\r
253                 generalPanel.setSpacing(4);\r
254 \r
255                 final Button add = new Button("Add Group", new ClickHandler() {\r
256                         @Override\r
257                         public void onClick(ClickEvent event) {\r
258                                 PermissionsAddDialog dlg = new PermissionsAddDialog(groups, permList, false);\r
259                                 dlg.center();\r
260                         }\r
261                 });\r
262                 add.getElement().setId("filePropertiesDialog.button.addGroup");\r
263                 permButtons.add(add);\r
264                 permButtons.setCellHorizontalAlignment(add, HasHorizontalAlignment.ALIGN_CENTER);\r
265 \r
266                 final Button addUser = new Button("Add User", new ClickHandler() {\r
267                         @Override\r
268                         public void onClick(ClickEvent event) {\r
269                                 PermissionsAddDialog dlg = new PermissionsAddDialog(groups, permList, true);\r
270                                 dlg.center();\r
271                         }\r
272                 });\r
273                 add.getElement().setId("filePropertiesDialog.button.addUser");\r
274                 permButtons.add(addUser);\r
275                 permButtons.setCellHorizontalAlignment(addUser, HasHorizontalAlignment.ALIGN_CENTER);\r
276 \r
277                 permButtons.setCellHorizontalAlignment(cancel, HasHorizontalAlignment.ALIGN_CENTER);\r
278                 permButtons.setSpacing(8);\r
279                 permButtons.addStyleName("gss-TabPanelBottom");\r
280 \r
281                 final Label readForAllNote = new Label("When this option is enabled, the file will be readable" +\r
282                                         " by everyone. By checking this option, you are certifying that you have the right to " +\r
283                                         "distribute this file and that it does not violate the Terms of Use.", true);\r
284                 readForAllNote.setVisible(false);\r
285                 readForAllNote.setStylePrimaryName("gss-readForAllNote");\r
286 \r
287                 readForAll = new CheckBox();\r
288                 readForAll.getElement().setId("filePropertiesDialog.checkBox.public");\r
289                 readForAll.setValue(file.isReadForAll());\r
290                 readForAll.addClickHandler(new ClickHandler() {\r
291                         @Override\r
292                         public void onClick(ClickEvent event) {\r
293                                 readForAllNote.setVisible(readForAll.getValue());\r
294                         }\r
295 \r
296                 });\r
297 \r
298                 permPanel.add(permList);\r
299                 permPanel.add(permButtons);\r
300                 // Only show the read for all permission if the user is the owner.\r
301                 if (file.getOwner().equals(GSS.get().getCurrentUserResource().getUsername())) {\r
302                         permForAll.add(new Label("Public"));\r
303                         permForAll.add(readForAll);\r
304                         permForAll.setSpacing(8);\r
305                         permForAll.addStyleName("gss-TabPanelBottom");\r
306                         permForAll.add(readForAllNote);\r
307                         permPanel.add(permForAll);\r
308                 }\r
309 \r
310                 TextBox path = new TextBox();\r
311                 path.setWidth("100%");\r
312                 path.addClickHandler(new ClickHandler() {\r
313                         @Override\r
314                         public void onClick(ClickEvent event) {\r
315                                 GSS.enableIESelection();\r
316                                 ((TextBox) event.getSource()).selectAll();\r
317                                 GSS.preventIESelection();\r
318                         }\r
319 \r
320                 });\r
321                 path.setText(file.getUri());\r
322                 path.getElement().setId("filePropertiesDialog.textBox.link");\r
323                 path.setTitle("Use this link for sharing the file via e-mail, IM, etc. (crtl-C/cmd-C to copy to system clipboard)");\r
324                 path.setWidth("100%");\r
325                 path.setReadOnly(true);\r
326                 pathPanel.setWidth("100%");\r
327                 pathPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);\r
328                 pathPanel.add(new Label("Link"));\r
329                 pathPanel.setSpacing(8);\r
330                 pathPanel.addStyleName("gss-TabPanelBottom");\r
331                 pathPanel.add(path);\r
332                 permPanel.add(pathPanel);\r
333 \r
334                 VersionsList verList = new VersionsList(this, images, bodies);\r
335                 verPanel.add(verList);\r
336 \r
337                 vPanel.setCellHorizontalAlignment(cancel, HasHorizontalAlignment.ALIGN_CENTER);\r
338                 vPanel.setSpacing(8);\r
339                 vPanel.addStyleName("gss-TabPanelBottom");\r
340                 vPanel.add(new Label("Versioned"));\r
341 \r
342                 vPanel.add(versioned);\r
343                 verPanel.add(vPanel);\r
344                 vPanel2.setCellHorizontalAlignment(cancel, HasHorizontalAlignment.ALIGN_CENTER);\r
345                 vPanel2.setSpacing(8);\r
346                 vPanel2.addStyleName("gss-TabPanelBottom");\r
347                 Button removeVersionsButton = new Button(AbstractImagePrototype.create(images.delete()).getHTML(), new ClickHandler() {\r
348                         @Override\r
349                         public void onClick(ClickEvent event) {\r
350                                 ConfirmationDialog confirm = new ConfirmationDialog("Really " +\r
351                                                 "remove all previous versions?", "Remove") {\r
352 \r
353                                         @Override\r
354                                         public void cancel() {\r
355                                         }\r
356 \r
357                                         @Override\r
358                                         public void confirm() {\r
359                                                 FilePropertiesDialog.this.closeDialog();\r
360                                                 removeAllOldVersions();\r
361                                         }\r
362 \r
363                                 };\r
364                                 confirm.center();\r
365                         }\r
366 \r
367                 });\r
368                 HTML removeAllVersion = new HTML("<span>Remove all previous versions?</span>");\r
369                 vPanel2.add(removeAllVersion);\r
370                 vPanel2.add(removeVersionsButton);\r
371                 verPanel.add(vPanel2);\r
372                 if(!file.isVersioned())\r
373                         vPanel2.setVisible(false);\r
374                 outer.add(inner);\r
375                 outer.add(buttons);\r
376                 outer.setCellHorizontalAlignment(buttons, HasHorizontalAlignment.ALIGN_CENTER);\r
377                 outer.addStyleName("gss-TabPanelBottom");\r
378 \r
379                 focusPanel.setFocus(true);\r
380                 setWidget(outer);\r
381         }\r
382 \r
383 \r
384         /**\r
385          * Accepts any change and updates the file\r
386          *\r
387          */\r
388         @Override\r
389         protected void accept() {\r
390                 String newFilename = null;\r
391                 permList.updatePermissionsAccordingToInput();\r
392                 Set<PermissionHolder> perms = permList.getPermissions();\r
393                 JSONObject json = new JSONObject();\r
394                 if (!name.getText().equals(file.getName())) {\r
395                         newFilename = name.getText();\r
396                         json.put("name", new JSONString(newFilename));\r
397                 }\r
398                 if (versioned.getValue() != file.isVersioned())\r
399                         json.put("versioned", JSONBoolean.getInstance(versioned.getValue()));\r
400                 //only update the read for all perm if the user is the owner\r
401                 if (readForAll.getValue() != file.isReadForAll())\r
402                         if (file.getOwner().equals(GSS.get().getCurrentUserResource().getUsername()))\r
403                                 json.put("readForAll", JSONBoolean.getInstance(readForAll.getValue()));\r
404                 int i = 0;\r
405                 if (permList.hasChanges()) {\r
406                         GWT.log("Permissions change", null);\r
407                         JSONArray perma = new JSONArray();\r
408 \r
409                         for (PermissionHolder p : perms) {\r
410                                 JSONObject po = new JSONObject();\r
411                                 if (p.getUser() != null)\r
412                                         po.put("user", new JSONString(p.getUser()));\r
413                                 if (p.getGroup() != null)\r
414                                         po.put("group", new JSONString(p.getGroup()));\r
415                                 po.put("read", JSONBoolean.getInstance(p.isRead()));\r
416                                 po.put("write", JSONBoolean.getInstance(p.isWrite()));\r
417                                 po.put("modifyACL", JSONBoolean.getInstance(p.isModifyACL()));\r
418                                 perma.set(i, po);\r
419                                 i++;\r
420                         }\r
421                         json.put("permissions", perma);\r
422                 }\r
423                 JSONArray taga = new JSONArray();\r
424                 i = 0;\r
425                 if (!tags.getText().equals(initialTagText)) {\r
426                         String[] tagset = tags.getText().split(",");\r
427                         for (String t : tagset) {\r
428                                 JSONString to = new JSONString(t);\r
429                                 taga.set(i, to);\r
430                                 i++;\r
431                         }\r
432                         json.put("tags", taga);\r
433                 }\r
434                 String jsonString = json.toString();\r
435                 if(jsonString.equals("{}")){\r
436                         GWT.log("NO CHANGES", null);\r
437                         return;\r
438                 }\r
439                 final String newFilenameFinal = newFilename;\r
440                 PostCommand cf = new PostCommand(file.getUri() + "?update=", jsonString, 200) {\r
441 \r
442                         @Override\r
443                         public void onComplete() {\r
444                                 GSS.get().getTreeView().refreshCurrentNode();\r
445                         }\r
446 \r
447                         @Override\r
448                         public void onError(Throwable t) {\r
449                                 GWT.log("", t);\r
450                                 if (t instanceof RestException) {\r
451                                         int statusCode = ((RestException) t).getHttpStatusCode();\r
452                                         if (statusCode == 405)\r
453                                                 GSS.get().displayError("You don't have the necessary permissions");\r
454                                         else if (statusCode == 404)\r
455                                                 GSS.get().displayError("User in permissions does not exist");\r
456                                         else if (statusCode == 409)\r
457                                                 GSS.get().displayError("A file with the same name already exists");\r
458                                         else if (statusCode == 413)\r
459                                                 GSS.get().displayError("Your quota has been exceeded");\r
460                                         else\r
461                                                 GSS.get().displayError("Unable to modify file:" + ((RestException) t).getHttpStatusText());\r
462                                 } else\r
463                                         GSS.get().displayError("System error modifying file:" + t.getMessage());\r
464                         }\r
465 \r
466                 };\r
467                 DeferredCommand.addCommand(cf);\r
468 \r
469         }\r
470 \r
471         private void removeAllOldVersions() {\r
472                 JSONObject json = new JSONObject();\r
473                 json.put("versioned", JSONBoolean.getInstance(false));\r
474                 GWT.log(json.toString(), null);\r
475                 PostCommand cf = new PostCommand(file.getUri() + "?update=", json.toString(), 200) {\r
476 \r
477                         @Override\r
478                         public void onComplete() {\r
479                                 toggleVersioned(true);\r
480                         }\r
481 \r
482                         @Override\r
483                         public void onError(Throwable t) {\r
484                                 GWT.log("", t);\r
485                                 if (t instanceof RestException) {\r
486                                         int statusCode = ((RestException) t).getHttpStatusCode();\r
487                                         if (statusCode == 405)\r
488                                                 GSS.get().displayError("You don't have the necessary permissions");\r
489                                         else if (statusCode == 404)\r
490                                                 GSS.get().displayError("User in permissions does not exist");\r
491                                         else if (statusCode == 409)\r
492                                                 GSS.get().displayError("A folder with the same name already exists");\r
493                                         else if (statusCode == 413)\r
494                                                 GSS.get().displayError("Your quota has been exceeded");\r
495                                         else\r
496                                                 GSS.get().displayError("Unable to modify file:" + ((RestException) t).getHttpStatusText());\r
497                                 } else\r
498                                         GSS.get().displayError("System error moifying file:" + t.getMessage());\r
499                         }\r
500                 };\r
501                 DeferredCommand.addCommand(cf);\r
502         }\r
503 \r
504         private void toggleVersioned(boolean versionedValue) {\r
505                 JSONObject json = new JSONObject();\r
506                 json.put("versioned", JSONBoolean.getInstance(versionedValue));\r
507                 GWT.log(json.toString(), null);\r
508                 PostCommand cf = new PostCommand(file.getUri() + "?update=", json.toString(), 200) {\r
509 \r
510                         @Override\r
511                         public void onComplete() {\r
512                                 GSS.get().getTreeView().refreshCurrentNode();\r
513                         }\r
514 \r
515                         @Override\r
516                         public void onError(Throwable t) {\r
517                                 GWT.log("", t);\r
518                                 if (t instanceof RestException) {\r
519                                         int statusCode = ((RestException) t).getHttpStatusCode();\r
520                                         if (statusCode == 405)\r
521                                                 GSS.get().displayError("You don't have the necessary permissions");\r
522                                         else if (statusCode == 404)\r
523                                                 GSS.get().displayError("User in permissions does not exist");\r
524                                         else if (statusCode == 409)\r
525                                                 GSS.get().displayError("A folder with the same name already exists");\r
526                                         else if (statusCode == 413)\r
527                                                 GSS.get().displayError("Your quota has been exceeded");\r
528                                         else\r
529                                                 GSS.get().displayError("Unable to modify file:" + ((RestException) t).getHttpStatusText());\r
530                                 } else\r
531                                         GSS.get().displayError("System error moifying file:" + t.getMessage());\r
532                         }\r
533                 };\r
534                 DeferredCommand.addCommand(cf);\r
535         }\r
536 \r
537 }\r