Skip to content

Commit

Permalink
Merge pull request robinrodricks#281 from peterfortuin/278_async_vers…
Browse files Browse the repository at this point in the history
…ions_of_methods_to_IFtpClient

Fixes robinrodricks#278 Added async versions of methods to IFtpClient
  • Loading branch information
robinrodricks authored Mar 20, 2018
2 parents 491c906 + 93d09fa commit becd036
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions FluentFTP/Client/IFtpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
using System.Security.Cryptography.X509Certificates;
using System.Text;

#if (CORE || NETFX)
using System.Threading;
#endif
#if (CORE || NET45)
using System.Threading.Tasks;
#endif

namespace FluentFTP {

/// <summary>
Expand Down Expand Up @@ -134,6 +141,24 @@ public interface IFtpClient : IDisposable {
bool Download(Stream outStream, string remotePath, IProgress<double> progress = null);
bool Download(out byte[] outBytes, string remotePath, IProgress<double> progress = null);

#if ASYNC
Task<int> UploadFilesAsync(IEnumerable<string> localPaths, string remoteDir, FtpExists existsMode, bool createRemoteDir, FtpVerify verifyOptions, FtpError errorHandling, CancellationToken token);
Task<int> UploadFilesAsync(IEnumerable<string> localPaths, string remoteDir, FtpExists existsMode = FtpExists.Overwrite, bool createRemoteDir = true, FtpVerify verifyOptions = FtpVerify.None, FtpError errorHandling = FtpError.None);
Task<int> DownloadFilesAsync(string localDir, IEnumerable<string> remotePaths, bool overwrite, FtpVerify verifyOptions, FtpError errorHandling, CancellationToken token);
Task<int> DownloadFilesAsync(string localDir, IEnumerable<string> remotePaths, bool overwrite = true, FtpVerify verifyOptions = FtpVerify.None, FtpError errorHandling = FtpError.None);
Task<bool> UploadFileAsync(string localPath, string remotePath, FtpExists existsMode, bool createRemoteDir, FtpVerify verifyOptions, CancellationToken token, IProgress<double> progress);
Task<bool> UploadFileAsync(string localPath, string remotePath, FtpExists existsMode = FtpExists.Overwrite, bool createRemoteDir = false, FtpVerify verifyOptions = FtpVerify.None);
Task<bool> UploadAsync(Stream fileStream, string remotePath, FtpExists existsMode, bool createRemoteDir, CancellationToken token, IProgress<double> progress);
Task<bool> UploadAsync(byte[] fileData, string remotePath, FtpExists existsMode, bool createRemoteDir, CancellationToken token, IProgress<double> progress);
Task<bool> UploadAsync(Stream fileStream, string remotePath, FtpExists existsMode = FtpExists.Overwrite, bool createRemoteDir = false);
Task<bool> UploadAsync(byte[] fileData, string remotePath, FtpExists existsMode = FtpExists.Overwrite, bool createRemoteDir = false);
Task<bool> DownloadFileAsync(string localPath, string remotePath, bool overwrite, FtpVerify verifyOptions, CancellationToken token, IProgress<double> progress);
Task<bool> DownloadFileAsync(string localPath, string remotePath, bool overwrite = true, FtpVerify verifyOptions = FtpVerify.None, IProgress<double> progress = null);
Task<bool> DownloadAsync(Stream outStream, string remotePath, CancellationToken token, IProgress<double> progress = null);
Task<bool> DownloadAsync(Stream outStream, string remotePath);
Task<byte[]> DownloadAsync(string remotePath, CancellationToken token, IProgress<double> progress = null);
Task<byte[]> DownloadAsync(string remotePath);
#endif

// HASH

Expand Down

0 comments on commit becd036

Please sign in to comment.