Revision 0bc032bf web_client/src/gr/grnet/pithos/web/client/GSS.java
b/web_client/src/gr/grnet/pithos/web/client/GSS.java | ||
---|---|---|
5 | 5 |
|
6 | 6 |
import com.google.gwt.core.client.Scheduler; |
7 | 7 |
import com.google.gwt.core.client.Scheduler.ScheduledCommand; |
8 |
import com.google.gwt.user.client.ui.DockPanel; |
|
9 |
import com.google.gwt.user.client.ui.HasVerticalAlignment; |
|
10 |
import com.google.gwt.view.client.ListDataProvider; |
|
11 | 8 |
import com.google.gwt.view.client.SelectionChangeEvent; |
12 |
import com.google.gwt.view.client.SelectionChangeEvent.Handler; |
|
13 | 9 |
import com.google.gwt.view.client.SingleSelectionModel; |
14 |
import com.google.gwt.view.client.TreeViewModel.NodeInfo; |
|
15 | 10 |
import gr.grnet.pithos.web.client.clipboard.Clipboard; |
16 | 11 |
import gr.grnet.pithos.web.client.commands.GetUserCommand; |
17 | 12 |
import gr.grnet.pithos.web.client.foldertree.AccountResource; |
... | ... | |
46 | 41 |
import com.google.gwt.i18n.client.DateTimeFormat; |
47 | 42 |
import com.google.gwt.resources.client.ClientBundle; |
48 | 43 |
import com.google.gwt.resources.client.ImageResource; |
49 |
import com.google.gwt.user.client.Command; |
|
50 | 44 |
import com.google.gwt.user.client.Cookies; |
51 | 45 |
import com.google.gwt.user.client.DOM; |
52 |
import com.google.gwt.user.client.DeferredCommand; |
|
53 | 46 |
import com.google.gwt.user.client.Event; |
54 | 47 |
import com.google.gwt.user.client.History; |
55 | 48 |
import com.google.gwt.user.client.Window; |
... | ... | |
309 | 302 |
} |
310 | 303 |
|
311 | 304 |
private void showFiles(Folder f) { |
312 |
Set<File> files = f.getFiles(); |
|
313 |
fileList.setFiles(new ArrayList<File>(files)); |
|
314 | 305 |
inner.selectTab(0); |
306 |
Set<File> files = f.getFiles(); |
|
307 |
Iterator<File> iter = files.iterator(); |
|
308 |
fetchFile(iter, files); |
|
309 |
} |
|
310 |
|
|
311 |
private void fetchFile(final Iterator<File> iter, final Set<File> files) { |
|
312 |
if (iter.hasNext()) { |
|
313 |
File file = iter.next(); |
|
314 |
String path = getApiPath() + username + "/" + file.getContainer() + "/" + file.getPath() + "?format=json"; |
|
315 |
GetRequest<File> getFile = new GetRequest<File>(File.class, path, file) { |
|
316 |
@Override |
|
317 |
public void onSuccess(File result) { |
|
318 |
fetchFile(iter, files); |
|
319 |
} |
|
320 |
|
|
321 |
@Override |
|
322 |
public void onError(Throwable t) { |
|
323 |
GWT.log("Error getting file", t); |
|
324 |
if (t instanceof RestException) |
|
325 |
GSS.get().displayError("Error getting file: " + ((RestException) t).getHttpStatusText()); |
|
326 |
else |
|
327 |
GSS.get().displayError("System error fetching file: " + t.getMessage()); |
|
328 |
} |
|
329 |
}; |
|
330 |
getFile.setHeader("X-Auth-Token", "0000"); |
|
331 |
Scheduler.get().scheduleDeferred(getFile); |
|
332 |
} |
|
333 |
else |
|
334 |
fileList.setFiles(new ArrayList<File>(files)); |
|
315 | 335 |
} |
316 | 336 |
|
317 | 337 |
/** |
Also available in: Unified diff