public async Task SetEntryContentAsync(SyncContext context, StateSyncEntry entry, Stream input, SyncSetEntryContentOptions options = null) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (entry == null) { throw new ArgumentNullException(nameof(entry)); } if (input == null) { throw new ArgumentNullException(nameof(input)); } // we can't update google docs if (IsGoogleDoc(entry)) { return; } options = options ?? new SyncSetEntryContentOptions(); var file = await Account.UploadFileAsync(entry.ParentId, entry.Id, entry.Name, entry.CreationTime.LocalDateTime, entry.LastWriteTime.LocalDateTime, input, options.CancellationToken).ConfigureAwait(false); if (file != null) { entry.Id = file.Id; } }
public async Task SetEntryContentAsync(SyncContext context, StateSyncEntry entry, Stream input, SyncSetEntryContentOptions options = null) { var item = new WebItem { Id = ToId(entry.Id) }; if (item.Id == Guid.Empty) { return; } item.Attributes = ToAttributes(entry); item.CreationTimeUtc = entry.CreationTime.ToUniversalTime().UtcDateTime; item.LastWriteTimeUtc = entry.LastWriteTime.ToUniversalTime().UtcDateTime; item.Length = entry.Size; item.Name = entry.Name; item.ParentId = ToId(entry.ParentId); var newItem = await item.UploadAsync(input).ConfigureAwait(false); if (newItem != null) { entry.Id = ToId(newItem.Id); } }