Closed
Description
It'll make the library much easier to use with async/await and fit the modern .NET async friendly way of working.
I'd suggest at minimum the following methods:
public Task<Stream> DownloadFileAsync(string path)
public Task<IEnumerable<SftpFile>> ListDirectoryAsync(string path)
public Task UploadFileAsync(string path, Stream stream, bool overwrite = false)
I've managed to wrap the old IAsyncResult
style API you already have for DownloadFile as follows:
await Task.Factory.FromAsync(this.sftpClient.BeginDownloadFile(remoteUri, stream), this.sftpClient.EndDownloadFile)
but I'm struggling to figure out the way to do the same for ListDirectory...