You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added support for deleting directories asynchronously (#1503)
* Added support for deleting directories asynchronously
* Clarify that the task represents the asynchronous delete operation
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
* Added DeleteAsync and DeleteDirectoryAsync to ISftpClient
* Inherit docs from interface
* Added additional tests for new async delete functions
* Update list directory test to use async delete methods
* x
---------
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
@@ -508,6 +516,20 @@ public interface ISftpClient : IBaseClient
508
516
/// <exception cref="ObjectDisposedException">The method was called after the client was disposed.</exception>
509
517
voidDeleteDirectory(stringpath);
510
518
519
+
/// <summary>
520
+
/// Asynchronously deletes a remote directory.
521
+
/// </summary>
522
+
/// <param name="path">The path of the directory to be deleted.</param>
523
+
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to observe.</param>
524
+
/// <returns>A <see cref="Task"/> that represents the asynchronous delete operation.</returns>
525
+
/// <exception cref="ArgumentException"><paramref name="path"/> is <see langword="null"/> or contains only whitespace characters.</exception>
526
+
/// <exception cref="SshConnectionException">Client is not connected.</exception>
527
+
/// <exception cref="SftpPathNotFoundException"><paramref name="path"/> was not found on the remote host.</exception>
528
+
/// <exception cref="SftpPermissionDeniedException">Permission to delete the directory was denied by the remote host. <para>-or-</para> A SSH command was denied by the server.</exception>
529
+
/// <exception cref="SshException">A SSH error where <see cref="Exception.Message"/> is the message from the remote host.</exception>
530
+
/// <exception cref="ObjectDisposedException">The method was called after the client was disposed.</exception>
@@ -449,18 +467,7 @@ public void DeleteFile(string path)
449
467
_sftpSession.RequestRemove(fullPath);
450
468
}
451
469
452
-
/// <summary>
453
-
/// Asynchronously deletes remote file specified by path.
454
-
/// </summary>
455
-
/// <param name="path">File to be deleted path.</param>
456
-
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to observe.</param>
457
-
/// <returns>A <see cref="Task"/> that represents the asynchronous delete operation.</returns>
458
-
/// <exception cref="ArgumentException"><paramref name="path"/> is <see langword="null"/> or contains only whitespace characters.</exception>
459
-
/// <exception cref="SshConnectionException">Client is not connected.</exception>
460
-
/// <exception cref="SftpPathNotFoundException"><paramref name="path"/> was not found on the remote host.</exception>
461
-
/// <exception cref="SftpPermissionDeniedException">Permission to delete the file was denied by the remote host. <para>-or-</para> A SSH command was denied by the server.</exception>
462
-
/// <exception cref="SshException">A SSH error where <see cref="Exception.Message"/> is the message from the remote host.</exception>
463
-
/// <exception cref="ObjectDisposedException">The method was called after the client was disposed.</exception>
0 commit comments