GetFileName() 공개 메소드

public GetFileName ( FlowRequest request ) : string
request FlowRequest
리턴 string
예제 #1
0
        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);
        }
예제 #2
0
        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);
        }