Added encoding to auth token when is passed as request parameter in GET
[pithos-web-client] / src / gr / grnet / pithos / web / client / FileContextMenu.java
index 33702a3..b19bde5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 GRNET S.A. All rights reserved.
+ * Copyright 2011-2012 GRNET S.A. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or
  * without modification, are permitted provided that the following
@@ -47,6 +47,7 @@ import gr.grnet.pithos.web.client.foldertree.Folder;
 
 import java.util.List;
 
+import com.google.gwt.http.client.URL;
 import com.google.gwt.resources.client.ClientBundle;
 import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.user.client.Command;
@@ -203,7 +204,6 @@ public class FileContextMenu extends PopupPanel {
         if (selectedFolder != null) {
                    if (!selectedFolder.isInTrash()) {
                        if (canWrite && app.getClipboard().hasFiles()) {
-                               List<File> files = (List<File>) app.getClipboard().getItem();
                                pasteItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.paste()).getHTML() + "&nbsp;Paste</span>", true, new PasteCommand(app, this, selectedFolder));
                                contextMenu.addItem(pasteItem);
                        }
@@ -249,7 +249,7 @@ public class FileContextMenu extends PopupPanel {
                        @Override
                        public void execute() {
                                for (File f : selectedFiles)
-                                       Window.open(app.getApiPath() + f.getOwner() + f.getUri() + "?X-Auth-Token=" + app.getToken(), "_blank", "");
+                                       Window.open(app.getApiPath() + f.getOwner() + f.getUri() + "?X-Auth-Token=" + URL.encodeQueryString(app.getToken()), "_blank", "");
                        }
                }));