/*
- * 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
@SuppressWarnings("unchecked")
@Override
public void execute() {
- app.updateFolder(((List<File>) resource).get(0).getParent(), true, null);
+ app.updateFolder(((List<File>) resource).get(0).getParent(), true, new Command() {
+
+ @Override
+ public void execute() {
+ app.updateTrash(false, null);
+ }
+ }, true);
}
});
}
trashFolder(toBeTrashed, new Command() {
@Override
public void execute() {
- app.updateFolder(toBeTrashed.getParent(), true, null);
+ app.updateFolder(toBeTrashed.getParent(), true, new Command() {
+
+ @Override
+ public void execute() {
+ app.updateTrash(false, null);
+ }
+ }, true);
}
});
String path = "/" + Pithos.TRASH_CONTAINER + "/" + f.getPrefix();
PutRequest createFolder = new PutRequest(app.getApiPath(), app.getUsername(), path) {
@Override
- public void onSuccess(@SuppressWarnings("unused") Resource result) {
+ public void onSuccess(Resource result) {
GetRequest<Folder> getFolder = new GetRequest<Folder>(Folder.class, app.getApiPath(), f.getOwner(), "/" + f.getContainer() + "?format=json&delimiter=/&prefix=" + URL.encodeQueryString(f.getPrefix()), f) {
@Override
@Override
public void execute() {
- DeleteRequest deleteFolder = new DeleteRequest(app.getApiPath(), _f.getOwner(), _f.getUri()) {
+ DeleteRequest deleteFolder = new DeleteRequest(app.getApiPath(), _f.getOwner(), URL.encode(_f.getUri())) {
@Override
- public void onSuccess(@SuppressWarnings("unused") Resource _result) {
+ public void onSuccess(Resource _result) {
if (callback != null)
callback.execute();
}
String path = "/" + Pithos.TRASH_CONTAINER + "/" + file.getPath();
PutRequest trashFile = new PutRequest(app.getApiPath(), app.getUsername(), path) {
@Override
- public void onSuccess(@SuppressWarnings("unused") Resource result) {
+ public void onSuccess(Resource result) {
trashFiles(iter, callback);
}