Updated copyright
[pithos-web-client] / src / gr / grnet / pithos / web / client / commands / EmptyTrashCommand.java
index ce836e8..88d7dbe 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
@@ -34,8 +34,6 @@
  */
 package gr.grnet.pithos.web.client.commands;
 
-import java.util.Iterator;
-
 import gr.grnet.pithos.web.client.Pithos;
 import gr.grnet.pithos.web.client.foldertree.File;
 import gr.grnet.pithos.web.client.foldertree.Folder;
@@ -44,6 +42,8 @@ import gr.grnet.pithos.web.client.rest.DeleteRequest;
 import gr.grnet.pithos.web.client.rest.GetRequest;
 import gr.grnet.pithos.web.client.rest.RestException;
 
+import java.util.Iterator;
+
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.core.client.Scheduler;
 import com.google.gwt.http.client.Response;
@@ -114,10 +114,10 @@ public class EmptyTrashCommand implements Command{
                                                                @Override
                                                                public void execute() {
                                                                        String path = _f.getUri();
-                                                                       DeleteRequest deleteF = new DeleteRequest(app.getApiPath(), _f.getOwner(), path) {
+                                                                       DeleteRequest deleteF = new DeleteRequest(app.getApiPath(), _f.getOwner(), URL.encode(path)) {
                                                                                
                                                                                @Override
-                                                                               public void onSuccess(@SuppressWarnings("unused") Resource result) {
+                                                                               public void onSuccess(Resource _result) {
                                                                                        deleteSubfolder(iter2, callback);
                                                                                }
                                                                                
@@ -174,10 +174,10 @@ public class EmptyTrashCommand implements Command{
                if (iter.hasNext()) {
                        File f = iter.next();
                        String path = f.getUri();
-                       DeleteRequest deleteF = new DeleteRequest(app.getApiPath(), f.getOwner(), path) {
+                       DeleteRequest deleteF = new DeleteRequest(app.getApiPath(), f.getOwner(), URL.encode(path)) {
                                
                                @Override
-                               public void onSuccess(@SuppressWarnings("unused") Resource result) {
+                               public void onSuccess(Resource result) {
                                        deleteFile(iter, callback);
                                }