/// <inheritdoc/> public async Task<IUnixFileSystemEntry> MoveAsync(IUnixDirectoryEntry parent, IUnixFileSystemEntry source, IUnixDirectoryEntry target, string fileName, CancellationToken cancellationToken) { var sourceItem = ((OneDriveFileSystemEntry)source).Item; var sourceId = sourceItem.Id; var newParentItem = ((OneDriveDirectoryEntry)target).Item; var newParentRef = new ItemReference() { Id = newParentItem.Id, }; _cache.Remove(GetFileId(sourceItem)); var newItem = await Service.MoveAsync(Drive.Id, sourceId, fileName, newParentRef, cancellationToken); _cache.Set(GetFileId(newItem), newItem, _defaultCacheTimeSpan); return await ConvertToUnixFileSystemEntry(newItem, cancellationToken); }
public Task<Item> MoveAsync([NotNull] string driveId, [NotNull] string itemId, [NotNull] string newName, ItemReference newParent, CancellationToken cancellationToken) { var newItemValues = new Item { Name = newName, ParentReference = newParent, }; return UpdateAsync(driveId, itemId, newItemValues, cancellationToken); }