Revision cc0120ab src/gr/grnet/pithos/web/client/commands/RestoreTrashCommand.java
b/src/gr/grnet/pithos/web/client/commands/RestoreTrashCommand.java | ||
---|---|---|
40 | 40 |
import gr.grnet.pithos.web.client.Pithos; |
41 | 41 |
import gr.grnet.pithos.web.client.foldertree.File; |
42 | 42 |
import gr.grnet.pithos.web.client.foldertree.Folder; |
43 |
import gr.grnet.pithos.web.client.foldertree.Resource; |
|
44 |
import gr.grnet.pithos.web.client.rest.DeleteRequest; |
|
45 |
import gr.grnet.pithos.web.client.rest.GetRequest; |
|
43 |
import gr.grnet.pithos.web.client.Resource; |
|
46 | 44 |
import gr.grnet.pithos.web.client.rest.PutRequest; |
47 | 45 |
import gr.grnet.pithos.web.client.rest.RestException; |
48 | 46 |
|
... | ... | |
111 | 109 |
|
112 | 110 |
private void untrashFolder(final Folder f, final Command callback) { |
113 | 111 |
String path = "/" + Pithos.HOME_CONTAINER + "/" + f.getPrefix(); |
114 |
app.copyFolder(f, app.getUsername(), path, true, callback);
|
|
112 |
app.copyFolder(f, app.getUserID(), path, true, callback);
|
|
115 | 113 |
} |
116 | 114 |
|
117 | 115 |
protected void untrashFiles(final Iterator<File> iter, final Command callback) { |
118 | 116 |
if (iter.hasNext()) { |
119 | 117 |
File file = iter.next(); |
120 | 118 |
String path = "/" + Pithos.HOME_CONTAINER + "/" + file.getPath(); |
121 |
PutRequest untrashFile = new PutRequest(app.getApiPath(), app.getUsername(), path) {
|
|
119 |
PutRequest untrashFile = new PutRequest(app.getApiPath(), app.getUserID(), path) {
|
|
122 | 120 |
@Override |
123 | 121 |
public void onSuccess(Resource result) { |
124 | 122 |
untrashFiles(iter, callback); |
... | ... | |
140 | 138 |
app.sessionExpired(); |
141 | 139 |
} |
142 | 140 |
}; |
143 |
untrashFile.setHeader("X-Auth-Token", app.getToken()); |
|
141 |
untrashFile.setHeader("X-Auth-Token", app.getUserToken());
|
|
144 | 142 |
untrashFile.setHeader("X-Move-From", URL.encodePathSegment(file.getUri())); |
145 | 143 |
untrashFile.setHeader("Content-Type", file.getContentType()); |
146 | 144 |
|
Also available in: Unified diff