*/\r
private AbstractImagePrototype getFileIcon(FileResource file) {\r
String mimetype = file.getContentType();\r
- boolean shared = file.isShared();\r
+ boolean shared=false;\r
+ Folders folders = GSS.get().getFolders();\r
+ if(folders.getCurrent() != null && folders.isOthersSharedItem(folders.getCurrent())){\r
+ DnDTreeItem otherUser = (DnDTreeItem) folders.getUserOfSharedItem(folders.getCurrent());\r
+ if(otherUser==null)\r
+ shared = false;\r
+ else{\r
+ String uname = otherUser.getOtherUserResource().getUsername();\r
+ if(uname==null)\r
+ uname = ((DnDTreeItem)folders.getSharesItem()).getOthersResource().getUsernameOfUri(otherUser.getOtherUserResource().getUri());\r
+ if(uname != null)\r
+ shared = file.isShared();\r
+ }\r
+ }\r
+ else\r
+ shared = file.isShared();\r
if (mimetype == null)\r
return shared ? AbstractImagePrototype.create(images.documentShared()) : AbstractImagePrototype.create(images.document());\r
mimetype = mimetype.toLowerCase();\r
updateFileCache(clearSelection);\r
else if (GSS.get().getFolders().getCurrent() != null) {\r
final DnDTreeItem folderItem = (DnDTreeItem) GSS.get().getFolders().getCurrent();\r
- if (folderItem.getFolderResource() != null) {\r
+ if(GSS.get().getFolders().isFileItem(folderItem) || GSS.get().getFolders().isMySharedItem(folderItem) || GSS.get().getFolders().isOthersSharedItem(folderItem)){\r
update(true);\r
- GetCommand<FolderResource> gf = new GetCommand<FolderResource>(FolderResource.class, folderItem.getFolderResource().getUri()) {\r
+ GetCommand<FolderResource> gf = new GetCommand<FolderResource>(FolderResource.class, folderItem.getFolderResource().getUri(),folderItem.getFolderResource()) {\r
\r
@Override\r
public void onComplete() {\r
filePaths[c] = fpath + "?" + Math.random();\r
c++;\r
}\r
- MultipleHeadCommand<FileResource> getFiles = new MultipleHeadCommand<FileResource>(FileResource.class, filePaths){\r
+ MultipleHeadCommand<FileResource> getFiles = new MultipleHeadCommand<FileResource>(FileResource.class, filePaths, folderItem.getFolderResource().getFileCache()){\r
\r
@Override\r
public void onComplete(){\r
int indexOfQuestionMark = p.lastIndexOf('?');\r
if(indexOfQuestionMark>0)\r
r.setUri(p.substring(0, indexOfQuestionMark));\r
+ GWT.log("FETCHED:"+r.getLastModifiedSince(), null);\r
}\r
folderItem.getFolderResource().setFiles(result);\r
+ folderItem.getFolderResource().setFilesExpanded(true);\r
updateFileCache(clearSelection, newFilename);\r
}\r
\r
};\r
DeferredCommand.addCommand(gf);\r
} else if (folderItem.getTrashResource() != null) {\r
- GetCommand<TrashResource> gt = new GetCommand<TrashResource>(TrashResource.class, folderItem.getTrashResource().getUri()) {\r
+ GetCommand<TrashResource> gt = new GetCommand<TrashResource>(TrashResource.class, folderItem.getTrashResource().getUri(), null) {\r
\r
@Override\r
public void onComplete() {\r
};\r
DeferredCommand.addCommand(gt);\r
} else if (folderItem.getSharedResource() != null) {\r
- GetCommand<SharedResource> gt = new GetCommand<SharedResource>(SharedResource.class, folderItem.getSharedResource().getUri()) {\r
+ GetCommand<SharedResource> gt = new GetCommand<SharedResource>(SharedResource.class, folderItem.getSharedResource().getUri(), null) {\r
\r
@Override\r
public void onComplete() {\r
};\r
DeferredCommand.addCommand(gt);\r
} else if (folderItem.getOtherUserResource() != null) {\r
- GetCommand<OtherUserResource> gt = new GetCommand<OtherUserResource>(OtherUserResource.class, folderItem.getOtherUserResource().getUri()) {\r
+ GetCommand<OtherUserResource> gt = new GetCommand<OtherUserResource>(OtherUserResource.class, folderItem.getOtherUserResource().getUri(), null) {\r
\r
@Override\r
public void onComplete() {\r