/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2012-2014 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
sendLocalBroadcast(EVENT_SINGLE_FOLDER_CONTENTS_SYNCED, mLocalFolder.getRemotePath(), result);
}
- if (result.isSuccess() && mIsShareSupported) {
- RemoteOperationResult shareResult = refreshSharesForFolder(client);
- if (shareResult.getCode() != ResultCode.FILE_NOT_FOUND) {
- result = shareResult;
- } // else , keep the previous result ; being conservative for servers where Sharing API is supported, but disabled
+ if (result.isSuccess() && mIsShareSupported && !mSyncFullAccount) {
+ refreshSharesForFolder(client); // share result is ignored
}
if (!mSyncFullAccount) {
if (remoteFile.isFolder()) {
remoteFile.setFileLength(localFile.getFileLength()); // TODO move operations about size of folders to FileContentProvider
}
+ remoteFile.setPublicLink(localFile.getPublicLink());
+ remoteFile.setShareByLink(localFile.isShareByLink());
} else {
remoteFile.setEtag(""); // remote eTag will not be updated unless contents are synchronized (Synchronize[File|Folder]Operation with remoteFile as parameter)
}
if (remoteFile.keepInSync()) {
SynchronizeFileOperation operation = new SynchronizeFileOperation( localFile,
remoteFile,
- mStorageManager,
- mAccount,
+ mAccount,
true,
mContext
);
+
filesToSyncContents.add(operation);
}
private void startContentSynchronizations(List<SynchronizeFileOperation> filesToSyncContents, OwnCloudClient client) {
RemoteOperationResult contentsResult = null;
for (SynchronizeFileOperation op: filesToSyncContents) {
- contentsResult = op.execute(client); // returns without waiting for upload or download finishes
+ contentsResult = op.execute(mStorageManager, mContext); // returns without waiting for upload or download finishes
if (!contentsResult.isSuccess()) {
if (contentsResult.getCode() == ResultCode.SYNC_CONFLICT) {
mConflictsFound++;
file.setMimetype(remote.getMimeType());
file.setModificationTimestamp(remote.getModifiedTimestamp());
file.setEtag(remote.getEtag());
+ file.setPermissions(remote.getPermissions());
+ file.setRemoteId(remote.getRemoteId());
return file;
}