GroupTreeViewModel groupTreeViewModel;
private GroupTreeView groupTreeView;
- private TreeView selectedTree;
+ TreeView selectedTree;
protected AccountResource account;
Folder trash;
private HTML numOfFiles;
+ private Image refreshButton;
+
private Image toolsButton;
@Override
header.setCellHorizontalAlignment(messagePanel, HasHorizontalAlignment.ALIGN_CENTER);
header.setCellVerticalAlignment(messagePanel, HasVerticalAlignment.ALIGN_MIDDLE);
+ refreshButton = new Image(images.refresh());
+ refreshButton.addStyleName("pithos-toolsButton");
+ refreshButton.setWidth("32px");
+ refreshButton.setHeight("32px");
+ refreshButton.addClickHandler(new ClickHandler() {
+
+ @Override
+ public void onClick(@SuppressWarnings("unused") ClickEvent event) {
+ boolean isFolderTreeSelected = selectedTree.equals(getFolderTreeView());
+ boolean otherSharedTreeSelected = selectedTree.equals(getOtherSharedTreeView());
+ Folder folder = getSelectedTree().getSelection();
+
+ if (folder != null && (isFolderTreeSelected || otherSharedTreeSelected))
+ updateFolder(folder, true, new Command() {
+
+ @Override
+ public void execute() {
+ updateStatistics();
+ }
+ });
+ }
+ });
+ header.add(refreshButton);
+ header.setCellHorizontalAlignment(refreshButton, HasHorizontalAlignment.ALIGN_CENTER);
+ header.setCellVerticalAlignment(refreshButton, HasVerticalAlignment.ALIGN_MIDDLE);
+ header.setCellWidth(refreshButton, "40px");
+
toolsButton = new Image(images.tools());
toolsButton.addStyleName("pithos-toolsButton");
toolsButton.addClickHandler(new ClickHandler() {
}
};
copyFile.setHeader("X-Auth-Token", getToken());
- copyFile.setHeader("X-Copy-From", file.getUri());
+ copyFile.setHeader("X-Copy-From", URL.encodePathSegment(file.getUri()));
if (!file.getOwner().equals(targetUsername))
- copyFile.setHeader("X-Source-Account", file.getOwner());
+ copyFile.setHeader("X-Source-Account", URL.encodePathSegment(file.getOwner()));
+ copyFile.setHeader("Content-Type", file.getContentType());
Scheduler.get().scheduleDeferred(copyFile);
}
else if (callback != null) {
public void logoff() {
Configuration conf = (Configuration) GWT.create(Configuration.class);
- Cookies.removeCookie(conf.authCookie());
+ Cookies.removeCookie(conf.authCookie(), "/");
Cookies.removeCookie(conf.authTokenCookie(), "/");
for (String s: Cookies.getCookieNames())
if (s.startsWith(conf.shibSessionCookiePrefix()))