Revision 68e165a9 src/gr/grnet/pithos/web/client/commands/PropertiesCommand.java
b/src/gr/grnet/pithos/web/client/commands/PropertiesCommand.java | ||
---|---|---|
43 | 43 |
import gr.grnet.pithos.web.client.Pithos; |
44 | 44 |
import gr.grnet.pithos.web.client.foldertree.File; |
45 | 45 |
import gr.grnet.pithos.web.client.foldertree.Folder; |
46 |
import gr.grnet.pithos.web.client.foldertree.Resource; |
|
47 |
import gr.grnet.pithos.web.client.rest.HeadRequest; |
|
48 |
import gr.grnet.pithos.web.client.rest.RestException; |
|
46 | 49 |
|
47 | 50 |
import java.util.List; |
48 | 51 |
|
52 |
import com.google.gwt.core.client.GWT; |
|
53 |
import com.google.gwt.core.client.Scheduler; |
|
54 |
import com.google.gwt.http.client.Response; |
|
49 | 55 |
import com.google.gwt.user.client.Command; |
50 | 56 |
import com.google.gwt.user.client.ui.PopupPanel; |
51 | 57 |
|
... | ... | |
66 | 72 |
|
67 | 73 |
private Object resource; |
68 | 74 |
|
69 |
private Pithos app;
|
|
75 |
Pithos app; |
|
70 | 76 |
|
71 | 77 |
/** |
72 | 78 |
* @param _containerPanel |
... | ... | |
109 | 115 |
else { |
110 | 116 |
switch (tabToShow) { |
111 | 117 |
case PROPERTIES: |
112 |
FilePropertiesDialog dlg = new FilePropertiesDialog(app, files.get(0)); |
|
113 |
dlg.center(); |
|
118 |
File f = files.get(0); |
|
119 |
final FilePropertiesDialog dlg = new FilePropertiesDialog(app, f); |
|
120 |
HeadRequest<File> headFile = new HeadRequest<File>(File.class, app.getApiPath(), f.getOwner(), f.getUri(), f) { |
|
121 |
|
|
122 |
@Override |
|
123 |
public void onSuccess(File _result) { |
|
124 |
dlg.center(); |
|
125 |
} |
|
126 |
|
|
127 |
@Override |
|
128 |
public void onError(Throwable t) { |
|
129 |
GWT.log("Error heading file", t); |
|
130 |
app.setError(t); |
|
131 |
if (t instanceof RestException) |
|
132 |
app.displayError("Error heading file: " + ((RestException) t).getHttpStatusText()); |
|
133 |
else |
|
134 |
app.displayError("System error heading folder: " + t.getMessage()); |
|
135 |
} |
|
136 |
|
|
137 |
@Override |
|
138 |
protected void onUnauthorized(Response response) { |
|
139 |
app.sessionExpired(); |
|
140 |
} |
|
141 |
}; |
|
142 |
headFile.setHeader("X-Auth-Token", app.getToken()); |
|
143 |
Scheduler.get().scheduleDeferred(headFile); |
|
114 | 144 |
break; |
115 | 145 |
case PERMISSIONS: |
116 | 146 |
FilePermissionsDialog dlg1 = new FilePermissionsDialog(app, files.get(0)); |
Also available in: Unified diff