From 25bb42032303b43ad585164ceee803ba82607b07 Mon Sep 17 00:00:00 2001 From: Martin Solarik Date: Mon, 7 Apr 2025 13:58:39 +0200 Subject: [PATCH] Added ExistsAsync and GetAsync to ISftpClient --- src/Renci.SshNet/ISftpClient.cs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/Renci.SshNet/ISftpClient.cs b/src/Renci.SshNet/ISftpClient.cs index d3c4b3b6a..2c37bbcbe 100644 --- a/src/Renci.SshNet/ISftpClient.cs +++ b/src/Renci.SshNet/ISftpClient.cs @@ -630,6 +630,22 @@ public interface ISftpClient : IBaseClient /// The method was called after the client was disposed. bool Exists(string path); + /// + /// Checks whether file or directory exists. + /// + /// The path. + /// The to observe. + /// + /// A that represents the exists operation. + /// The task result contains if directory or file exists; otherwise . + /// + /// is or contains only whitespace characters. + /// Client is not connected. + /// Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. + /// A SSH error where is the message from the remote host. + /// The method was called after the client was disposed. + Task ExistsAsync(string path, CancellationToken cancellationToken = default); + /// /// Gets reference to remote file or directory. /// @@ -643,6 +659,21 @@ public interface ISftpClient : IBaseClient /// The method was called after the client was disposed. ISftpFile Get(string path); + /// + /// Gets reference to remote file or directory. + /// + /// The path. + /// The to observe. + /// + /// A that represents the get operation. + /// The task result contains the reference to file object. + /// + /// Client is not connected. + /// was not found on the remote host. + /// is . + /// The method was called after the client was disposed. + Task GetAsync(string path, CancellationToken cancellationToken); + /// /// Gets the of the file on the path. ///