-
-
Notifications
You must be signed in to change notification settings - Fork 951
Add UploadFileAsync and DownloadFileAsync methods #1634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UploadFileAsync and DownloadFileAsync methods #1634
Conversation
actions don't seem to be triggering, gonna try closing and reopening |
Hi, I will make time to review most likely at some point next week. FYI for first time contributors the CI needs to be run manually (some kind of github security measure) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I think it could do with testing cancellation - i.e. that it throws OperationCanceledException
when the token is cancelled.
It would probably not be very reliable to test cancelling during a file download (at least not in an integration test), but we could at least have a test for when a cancelled token is supplied
test/Renci.SshNet.IntegrationTests/OldIntegrationTests/SftpClientTest.cs
Outdated
Show resolved
Hide resolved
test/Renci.SshNet.IntegrationTests/TestsFixtures/IntegrationTestBase.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Adds TAP methods for
UploadFile
andDownloadFile
toISftpClient
.Other Solutions
While there are other options to define both the
UploadFileAsync
andDownloadFileAsync
methods, such as the extension methods approach and the previously proposed pull request, #1515 , this pull request has the following benefits over the other solutions:UploadFile
andDownloadFile
methodsBeginUploadFile
, which pretty much runs the sync UploadFile method, but just in a different thread