Skip to content

Commit

Permalink
SftpClient: use nameof for ArgumentException
Browse files Browse the repository at this point in the history
  • Loading branch information
mus65 committed Mar 5, 2024
1 parent ccd6802 commit fd605c4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Renci.SshNet/SftpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public void DeleteDirectory(string path)

if (string.IsNullOrWhiteSpace(path))
{
throw new ArgumentException("path");
throw new ArgumentException(nameof(path));
}

if (_sftpSession is null)
Expand Down Expand Up @@ -383,7 +383,7 @@ public void DeleteFile(string path)

if (string.IsNullOrWhiteSpace(path))
{
throw new ArgumentException("path");
throw new ArgumentException(nameof(path));
}

if (_sftpSession is null)
Expand Down Expand Up @@ -414,7 +414,7 @@ public async Task DeleteFileAsync(string path, CancellationToken cancellationTok

if (string.IsNullOrWhiteSpace(path))
{
throw new ArgumentException("path");
throw new ArgumentException(nameof(path));
}

if (_sftpSession is null)
Expand Down Expand Up @@ -541,12 +541,12 @@ public void SymbolicLink(string path, string linkPath)

if (string.IsNullOrWhiteSpace(path))
{
throw new ArgumentException("path");
throw new ArgumentException(nameof(path));
}

if (string.IsNullOrWhiteSpace(linkPath))
{
throw new ArgumentException("linkPath");
throw new ArgumentException(nameof(linkPath));
}

if (_sftpSession is null)
Expand Down Expand Up @@ -743,7 +743,7 @@ public bool Exists(string path)

if (string.IsNullOrWhiteSpace(path))
{
throw new ArgumentException("path");
throw new ArgumentException(nameof(path));
}

if (_sftpSession is null)
Expand Down Expand Up @@ -874,7 +874,7 @@ public IAsyncResult BeginDownloadFile(string path, Stream output, AsyncCallback?

if (string.IsNullOrWhiteSpace(path))
{
throw new ArgumentException("path");
throw new ArgumentException(nameof(path));
}

if (output is null)
Expand Down Expand Up @@ -1096,7 +1096,7 @@ public IAsyncResult BeginUploadFile(Stream input, string path, bool canOverride,

if (string.IsNullOrWhiteSpace(path))
{
throw new ArgumentException("path");
throw new ArgumentException(nameof(path));
}

var flags = Flags.Write | Flags.Truncate;
Expand Down Expand Up @@ -2091,7 +2091,7 @@ public IEnumerable<FileInfo> SynchronizeDirectories(string sourcePath, string de

if (string.IsNullOrWhiteSpace(destinationPath))
{
throw new ArgumentException("destinationPath");
throw new ArgumentException(nameof(destinationPath));
}

return InternalSynchronizeDirectories(sourcePath, destinationPath, searchPattern, asynchResult: null);
Expand Down Expand Up @@ -2120,7 +2120,7 @@ public IAsyncResult BeginSynchronizeDirectories(string sourcePath, string destin

if (string.IsNullOrWhiteSpace(destinationPath))
{
throw new ArgumentException("destDir");
throw new ArgumentException(nameof(destinationPath));
}

if (searchPattern is null)
Expand Down Expand Up @@ -2338,7 +2338,7 @@ private void InternalDownloadFile(string path, Stream output, SftpDownloadAsyncR

if (string.IsNullOrWhiteSpace(path))
{
throw new ArgumentException("path");
throw new ArgumentException(nameof(path));
}

if (_sftpSession is null)
Expand Down Expand Up @@ -2404,7 +2404,7 @@ private void InternalUploadFile(Stream input, string path, Flags flags, SftpUplo

if (string.IsNullOrWhiteSpace(path))
{
throw new ArgumentException("path");
throw new ArgumentException(nameof(path));
}

if (_sftpSession is null)
Expand Down

0 comments on commit fd605c4

Please sign in to comment.