use of com.owncloud.android.lib.resources.shares.ShareResponse in project android by owncloud.
the class RefreshFolderOperation method updateShareIconsInFiles.
private void updateShareIconsInFiles(OwnCloudClient client) {
RemoteOperationResult<ShareResponse> result;
// remote request
GetRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(mLocalFolder.getRemotePath(), true, true);
result = operation.execute(client);
if (result.isSuccess()) {
resetShareFlagsInFolderChilds();
for (RemoteShare remoteShare : result.getData().getShares()) {
OCFile file = getStorageManager().getFileByPath(remoteShare.getPath());
if (file != null) {
ShareType shareType = ShareType.Companion.fromValue(remoteShare.getShareType().getValue());
if (shareType.equals(ShareType.PUBLIC_LINK)) {
file.setSharedViaLink(true);
} else if (shareType.equals(ShareType.USER) || shareType.equals(ShareType.FEDERATED) || shareType.equals(ShareType.GROUP)) {
file.setSharedWithSharee(true);
}
getStorageManager().saveFile(file);
}
}
}
}
Aggregations