ren method

This commit is contained in:
Collin M. Barrett 2019-07-10 08:52:51 -05:00
parent 4659dd1945
commit 8e7306ebd9
5 changed files with 5 additions and 5 deletions

View file

@ -7,6 +7,6 @@ namespace FilterLists.Agent.Core.List
{
public interface IListRepository
{
Task<Stream> GetListStreamAsync(Uri url, CancellationToken cancellationToken);
Task<Stream> GetAsStreamAsync(Uri url, CancellationToken cancellationToken);
}
}

View file

@ -34,7 +34,7 @@ public Handler(IListRepository listRepository)
protected override async Task Handle(Command request, CancellationToken cancellationToken)
{
var destinationPath = BuildDestinationPath(request);
using var input = await _repo.GetListStreamAsync(request.ListUrl.ViewUrl, cancellationToken);
using var input = await _repo.GetAsStreamAsync(request.ListUrl.ViewUrl, cancellationToken);
using var output = File.OpenWrite(destinationPath);
await input.CopyToAsync(output, cancellationToken);
}

View file

@ -34,7 +34,7 @@ public Handler(IListRepository listRepository)
protected override async Task Handle(Command request, CancellationToken cancellationToken)
{
var destinationDirectoryPath = Path.Combine(RepoDirectory, $"{request.ListUrl.Id}");
using var input = await _repo.GetListStreamAsync(request.ListUrl.ViewUrl, cancellationToken);
using var input = await _repo.GetAsStreamAsync(request.ListUrl.ViewUrl, cancellationToken);
using var archive = SevenZipArchive.Open(input);
foreach (var entry in archive.Entries)
if (!entry.IsDirectory)

View file

@ -33,7 +33,7 @@ public Handler(IListRepository listRepository)
protected override async Task Handle(Command request, CancellationToken cancellationToken)
{
var destinationDirectoryPath = Path.Combine(RepoDirectory, $"{request.ListUrl.Id}");
using var input = await _repo.GetListStreamAsync(request.ListUrl.ViewUrl, cancellationToken);
using var input = await _repo.GetAsStreamAsync(request.ListUrl.ViewUrl, cancellationToken);
using var reader = ReaderFactory.Open(input);
while (reader.MoveToNextEntry())
if (!reader.Entry.IsDirectory)

View file

@ -27,7 +27,7 @@ public ListRepository(HttpClient httpClient, ILogger<ListRepository> logger)
_logger = logger;
}
public async Task<Stream> GetListStreamAsync(Uri url, CancellationToken cancellationToken)
public async Task<Stream> GetAsStreamAsync(Uri url, CancellationToken cancellationToken)
{
using var response = await _httpClient.GetAsync(url, cancellationToken);
if (response.IsSuccessStatusCode)