private static string GetChunkFilePath(FlowRequestContext context, FlowRequest request) { return string.Concat( context.GetChunkPathFunc(request), "/", context.GetChunkFileName(request)); }
private static string GetChunkFilePath(FlowRequestContext context, FlowRequest request) { return(string.Concat( context.GetChunkPathFunc(request), "/", context.GetChunkFileName(request))); }
private async Task CombineAsync(FlowRequestContext context, FlowRequest request) { var filePath = string.Concat( context.GetFilePathFunc(request), "/", context.GetFileName(request)); var chunkPath = context.GetChunkPathFunc(request); var chunkFilePaths = await _fileSystem.ListDirectoryAsync(chunkPath).ConfigureAwait(false); using (var fileStream = await _fileSystem.OpenWriteAsync(filePath).ConfigureAwait(false)) { foreach (var file in chunkFilePaths) { using (var sourceStream = await _fileSystem.OpenReadAsync(file).ConfigureAwait(false)) { await sourceStream.CopyToAsync(fileStream).ConfigureAwait(false); } } await fileStream.FlushAsync().ConfigureAwait(false); } await _fileSystem.DeleteDirectoryAsync(chunkPath).ConfigureAwait(false); }
private async Task CombineAsync(FlowRequestContext context, FlowRequest request) { var filePath = string.Concat( context.GetFilePathFunc(request), "/", context.GetFileName(request)); var chunkPath = context.GetChunkPathFunc(request); var chunkFilePaths = await _fileSystem.ListDirectoryAsync(chunkPath); using (var fileStream = await _fileSystem.OpenWriteAsync(filePath)) { foreach (var file in chunkFilePaths) { using (var sourceStream = await _fileSystem.OpenReadAsync(file)) { await sourceStream.CopyToAsync(fileStream); } } await fileStream.FlushAsync(); } await _fileSystem.DeleteDirectoryAsync(chunkPath); }