protected override async Task <CopyFileResult> CopyFileAsync( OperationContext context, IRemoteFileCopier copier, ContentLocation sourcePath, AbsolutePath destinationPath, long expectedContentSize, bool overwrite, CopyOptions options, CancellationToken cancellationToken) { // TODO: why the destination str using var destinationStream = FileSystem.OpenForWrite(destinationPath, sourcePath.Size, FileMode.Create, FileShare.None, FileOptions.None, 1024); return(await copier.CopyToAsync(context, sourcePath, destinationStream, options)); }
public static Task <CopyFileResult> CopyToAsync <T>(this IRemoteFileCopier <T> remoteFileCopier, OperationContext context, T sourcePath, Stream destinationStream, long expectedContentSize) where T : PathBase { return(remoteFileCopier.CopyToAsync(context, sourcePath, destinationStream, expectedContentSize, options: default)); }