Skip to content

Commit 76fdf58

Browse files
committed
Improve slashdocs.
1 parent 563349d commit 76fdf58

File tree

1 file changed

+48
-31
lines changed

1 file changed

+48
-31
lines changed

src/Renci.SshNet/SftpClient.cs

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ public SftpClient(string host, string username, params PrivateKeyFile[] keyFiles
206206
/// <param name="ownsConnectionInfo">Specified whether this instance owns the connection info.</param>
207207
/// <exception cref="ArgumentNullException"><paramref name="connectionInfo"/> is null.</exception>
208208
/// <remarks>
209-
/// If <paramref name="ownsConnectionInfo"/> is <c>true</c>, then the
210-
/// connection info will be disposed when this instance is disposed.
209+
/// If <paramref name="ownsConnectionInfo"/> is <c>true</c>, the connection info will be disposed when this
210+
/// instance is disposed.
211211
/// </remarks>
212212
private SftpClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo)
213213
: this(connectionInfo, ownsConnectionInfo, new ServiceFactory())
@@ -223,8 +223,8 @@ private SftpClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo)
223223
/// <exception cref="ArgumentNullException"><paramref name="connectionInfo"/> is null.</exception>
224224
/// <exception cref="ArgumentNullException"><paramref name="serviceFactory"/> is null.</exception>
225225
/// <remarks>
226-
/// If <paramref name="ownsConnectionInfo"/> is <c>true</c>, then the
227-
/// connection info will be disposed when this instance is disposed.
226+
/// If <paramref name="ownsConnectionInfo"/> is <c>true</c>, the connection info will be disposed when this
227+
/// instance is disposed.
228228
/// </remarks>
229229
internal SftpClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory)
230230
: base(connectionInfo, ownsConnectionInfo, serviceFactory)
@@ -438,7 +438,7 @@ public void SymbolicLink(string path, string linkPath)
438438
/// <param name="path">The path.</param>
439439
/// <param name="listCallback">The list callback.</param>
440440
/// <returns>
441-
/// List of directory entries
441+
/// A list of files.
442442
/// </returns>
443443
/// <exception cref="ArgumentNullException"><paramref name="path" /> is <b>null</b>.</exception>
444444
/// <exception cref="SshConnectionException">Client is not connected.</exception>
@@ -499,9 +499,9 @@ public IAsyncResult BeginListDirectory(string path, AsyncCallback asyncCallback,
499499
/// </summary>
500500
/// <param name="asyncResult">The pending asynchronous SFTP request.</param>
501501
/// <returns>
502-
/// List of files
502+
/// A list of files.
503503
/// </returns>
504-
/// <exception cref="ArgumentException">The IAsyncResult object (<paramref name="asyncResult"/>) did not come from the corresponding async method on this type. <para>-or-</para> EndExecute was called multiple times with the same IAsyncResult.</exception>
504+
/// <exception cref="ArgumentException">The <see cref="IAsyncResult"/> object did not come from the corresponding async method on this type.<para>-or-</para><see cref="EndListDirectory(IAsyncResult)"/> was called multiple times with the same <see cref="IAsyncResult"/>.</exception>
505505
public IEnumerable<SftpFile> EndListDirectory(IAsyncResult asyncResult)
506506
{
507507
var ar = asyncResult as SftpListDirectoryAsyncResult;
@@ -719,7 +719,7 @@ public IAsyncResult BeginDownloadFile(string path, Stream output, AsyncCallback
719719
/// Ends an asynchronous file downloading into the stream.
720720
/// </summary>
721721
/// <param name="asyncResult">The pending asynchronous SFTP request.</param>
722-
/// <exception cref="ArgumentException">The IAsyncResult object (<paramref name="asyncResult"/>) did not come from the corresponding async method on this type. <para>-or-</para> EndExecute was called multiple times with the same IAsyncResult.</exception>
722+
/// <exception cref="ArgumentException">The <see cref="IAsyncResult"/> object did not come from the corresponding async method on this type.<para>-or-</para><see cref="EndDownloadFile(IAsyncResult)"/> was called multiple times with the same <see cref="IAsyncResult"/>.</exception>
723723
/// <exception cref="SshConnectionException">Client is not connected.</exception>
724724
/// <exception cref="SftpPermissionDeniedException">Permission to perform the operation was denied by the remote host. <para>-or-</para> A SSH command was denied by the server.</exception>
725725
/// <exception cref="SftpPathNotFoundException">The path was not found on the remote host.</exception>
@@ -944,7 +944,7 @@ public IAsyncResult BeginUploadFile(Stream input, string path, bool canOverride,
944944
/// Ends an asynchronous uploading the stream into remote file.
945945
/// </summary>
946946
/// <param name="asyncResult">The pending asynchronous SFTP request.</param>
947-
/// <exception cref="ArgumentException">The IAsyncResult object (<paramref name="asyncResult" />) did not come from the corresponding async method on this type. <para>-or-</para> EndExecute was called multiple times with the same IAsyncResult.</exception>
947+
/// <exception cref="ArgumentException">The <see cref="IAsyncResult"/> object did not come from the corresponding async method on this type.<para>-or-</para><see cref="EndUploadFile(IAsyncResult)"/> was called multiple times with the same <see cref="IAsyncResult"/>.</exception>
948948
/// <exception cref="SshConnectionException">Client is not connected.</exception>
949949
/// <exception cref="SftpPathNotFoundException">The directory of the file was not found on the remote host.</exception>
950950
/// <exception cref="SftpPermissionDeniedException">Permission to upload the file was denied by the remote host. <para>-or-</para> A SSH command was denied by the server.</exception>
@@ -965,7 +965,7 @@ public void EndUploadFile(IAsyncResult asyncResult)
965965
/// </summary>
966966
/// <param name="path">The path.</param>
967967
/// <returns>
968-
/// A reference to <see cref="SftpFileSytemInformation"/> object that contains file status information.
968+
/// A <see cref="SftpFileSytemInformation"/> instance that contains file status information.
969969
/// </returns>
970970
/// <exception cref="SshConnectionException">Client is not connected.</exception>
971971
/// <exception cref="ArgumentNullException"><paramref name="path" /> is <b>null</b>.</exception>
@@ -1220,7 +1220,8 @@ public void Delete(string path)
12201220
/// </summary>
12211221
/// <param name="path">The file or directory for which to obtain access date and time information.</param>
12221222
/// <returns>
1223-
/// A <see cref="DateTime"/> structure set to the date and time that the specified file or directory was last accessed. This value is expressed in local time.
1223+
/// A <see cref="DateTime"/> structure set to the date and time that the specified file or directory was last accessed.
1224+
/// This value is expressed in local time.
12241225
/// </returns>
12251226
/// <exception cref="ArgumentNullException"><paramref name="path"/> is <b>null</b>.</exception>
12261227
/// <exception cref="SshConnectionException">Client is not connected.</exception>
@@ -1236,7 +1237,8 @@ public DateTime GetLastAccessTime(string path)
12361237
/// </summary>
12371238
/// <param name="path">The file or directory for which to obtain access date and time information.</param>
12381239
/// <returns>
1239-
/// A <see cref="DateTime"/> structure set to the date and time that the specified file or directory was last accessed. This value is expressed in UTC time.
1240+
/// A <see cref="DateTime"/> structure set to the date and time that the specified file or directory was last accessed.
1241+
/// This value is expressed in UTC time.
12401242
/// </returns>
12411243
/// <exception cref="ArgumentNullException"><paramref name="path"/> is <b>null</b>.</exception>
12421244
/// <exception cref="SshConnectionException">Client is not connected.</exception>
@@ -1252,7 +1254,8 @@ public DateTime GetLastAccessTimeUtc(string path)
12521254
/// </summary>
12531255
/// <param name="path">The file or directory for which to obtain write date and time information.</param>
12541256
/// <returns>
1255-
/// A <see cref="DateTime"/> structure set to the date and time that the specified file or directory was last written to. This value is expressed in local time.
1257+
/// A <see cref="DateTime"/> structure set to the date and time that the specified file or directory was last written to.
1258+
/// This value is expressed in local time.
12561259
/// </returns>
12571260
/// <exception cref="ArgumentNullException"><paramref name="path"/> is <b>null</b>.</exception>
12581261
/// <exception cref="SshConnectionException">Client is not connected.</exception>
@@ -1268,7 +1271,8 @@ public DateTime GetLastWriteTime(string path)
12681271
/// </summary>
12691272
/// <param name="path">The file or directory for which to obtain write date and time information.</param>
12701273
/// <returns>
1271-
/// A <see cref="DateTime"/> structure set to the date and time that the specified file or directory was last written to. This value is expressed in UTC time.
1274+
/// A <see cref="DateTime"/> structure set to the date and time that the specified file or directory was last written to.
1275+
/// This value is expressed in UTC time.
12721276
/// </returns>
12731277
/// <exception cref="ArgumentNullException"><paramref name="path"/> is <b>null</b>.</exception>
12741278
/// <exception cref="SshConnectionException">Client is not connected.</exception>
@@ -1366,7 +1370,7 @@ public SftpFileStream OpenWrite(string path)
13661370
}
13671371

13681372
/// <summary>
1369-
/// Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
1373+
/// Opens a binary file, reads the contents of the file into a byte array, and closes the file.
13701374
/// </summary>
13711375
/// <param name="path">The file to open for reading.</param>
13721376
/// <returns>
@@ -1386,7 +1390,7 @@ public byte[] ReadAllBytes(string path)
13861390
}
13871391

13881392
/// <summary>
1389-
/// Opens a text file, reads all lines of the file using UTF-8 encoding, and then closes the file.
1393+
/// Opens a text file, reads all lines of the file using UTF-8 encoding, and closes the file.
13901394
/// </summary>
13911395
/// <param name="path">The file to open for reading.</param>
13921396
/// <returns>
@@ -1401,7 +1405,7 @@ public string[] ReadAllLines(string path)
14011405
}
14021406

14031407
/// <summary>
1404-
/// Opens a file, reads all lines of the file with the specified encoding, and then closes the file.
1408+
/// Opens a file, reads all lines of the file with the specified encoding, and closes the file.
14051409
/// </summary>
14061410
/// <param name="path">The file to open for reading.</param>
14071411
/// <param name="encoding">The encoding applied to the contents of the file.</param>
@@ -1425,7 +1429,7 @@ public string[] ReadAllLines(string path, Encoding encoding)
14251429
}
14261430

14271431
/// <summary>
1428-
/// Opens a text file, reads all lines of the file with the UTF-8 encoding, and then closes the file.
1432+
/// Opens a text file, reads all lines of the file with the UTF-8 encoding, and closes the file.
14291433
/// </summary>
14301434
/// <param name="path">The file to open for reading.</param>
14311435
/// <returns>
@@ -1440,7 +1444,7 @@ public string ReadAllText(string path)
14401444
}
14411445

14421446
/// <summary>
1443-
/// Opens a file, reads all lines of the file with the specified encoding, and then closes the file.
1447+
/// Opens a file, reads all lines of the file with the specified encoding, and closes the file.
14441448
/// </summary>
14451449
/// <param name="path">The file to open for reading.</param>
14461450
/// <param name="encoding">The encoding applied to the contents of the file.</param>
@@ -1711,7 +1715,9 @@ public void WriteAllText(string path, string contents, Encoding encoding)
17111715
/// Gets the <see cref="SftpFileAttributes"/> of the file on the path.
17121716
/// </summary>
17131717
/// <param name="path">The path to the file.</param>
1714-
/// <returns>The <see cref="SftpFileAttributes"/> of the file on the path.</returns>
1718+
/// <returns>
1719+
/// The <see cref="SftpFileAttributes"/> of the file on the path.
1720+
/// </returns>
17151721
/// <exception cref="ArgumentNullException"><paramref name="path"/> is <b>null</b>.</exception>
17161722
/// <exception cref="SshConnectionException">Client is not connected.</exception>
17171723
/// <exception cref="SftpPathNotFoundException"><paramref name="path"/> was not found on the remote host.</exception>
@@ -1767,9 +1773,19 @@ public void SetAttributes(string path, SftpFileAttributes fileAttributes)
17671773
/// <param name="sourcePath">The source path.</param>
17681774
/// <param name="destinationPath">The destination path.</param>
17691775
/// <param name="searchPattern">The search pattern.</param>
1770-
/// <returns>List of uploaded files.</returns>
1776+
/// <returns>
1777+
/// A list of uploaded files.
1778+
/// </returns>
1779+
/// <exception cref="ArgumentNullException"><paramref name="sourcePath"/> is <c>null</c>.</exception>
1780+
/// <exception cref="ArgumentException"><paramref name="destinationPath"/> is <c>null</c> or contains only whitespace.</exception>
1781+
/// <exception cref="SftpPathNotFoundException"><paramref name="destinationPath"/> was not found on the remote host.</exception>
17711782
public IEnumerable<FileInfo> SynchronizeDirectories(string sourcePath, string destinationPath, string searchPattern)
17721783
{
1784+
if (sourcePath == null)
1785+
throw new ArgumentNullException("sourcePath");
1786+
if (destinationPath.IsNullOrWhiteSpace())
1787+
throw new ArgumentException("destinationPath");
1788+
17731789
return InternalSynchronizeDirectories(sourcePath, destinationPath, searchPattern, null);
17741790
}
17751791

@@ -1782,10 +1798,10 @@ public IEnumerable<FileInfo> SynchronizeDirectories(string sourcePath, string de
17821798
/// <param name="asyncCallback">The async callback.</param>
17831799
/// <param name="state">The state.</param>
17841800
/// <returns>
1785-
/// An <see cref="System.IAsyncResult" /> that represents the asynchronous directory synchronization.
1801+
/// An <see cref="IAsyncResult" /> that represents the asynchronous directory synchronization.
17861802
/// </returns>
1787-
/// <exception cref="System.ArgumentNullException"><paramref name="sourcePath"/> is <c>null</c>.</exception>
1788-
/// <exception cref="System.ArgumentException"><paramref name="destinationPath"/> is <c>null</c> or contains only whitespace.</exception>
1803+
/// <exception cref="ArgumentNullException"><paramref name="sourcePath"/> is <c>null</c>.</exception>
1804+
/// <exception cref="ArgumentException"><paramref name="destinationPath"/> is <c>null</c> or contains only whitespace.</exception>
17891805
public IAsyncResult BeginSynchronizeDirectories(string sourcePath, string destinationPath, string searchPattern, AsyncCallback asyncCallback, object state)
17901806
{
17911807
if (sourcePath == null)
@@ -1816,8 +1832,11 @@ public IAsyncResult BeginSynchronizeDirectories(string sourcePath, string destin
18161832
/// Ends the synchronize directories.
18171833
/// </summary>
18181834
/// <param name="asyncResult">The async result.</param>
1819-
/// <returns>List of uploaded files.</returns>
1820-
/// <exception cref="System.ArgumentException">Either the IAsyncResult object did not come from the corresponding async method on this type, or EndExecute was called multiple times with the same IAsyncResult.</exception>
1835+
/// <returns>
1836+
/// A list of uploaded files.
1837+
/// </returns>
1838+
/// <exception cref="ArgumentException">The <see cref="IAsyncResult"/> object did not come from the corresponding async method on this type.<para>-or-</para><see cref="EndSynchronizeDirectories(IAsyncResult)"/> was called multiple times with the same <see cref="IAsyncResult"/>.</exception>
1839+
/// <exception cref="SftpPathNotFoundException">The destination path was not found on the remote host.</exception>
18211840
public IEnumerable<FileInfo> EndSynchronizeDirectories(IAsyncResult asyncResult)
18221841
{
18231842
var ar = asyncResult as SftpSynchronizeDirectoriesAsyncResult;
@@ -1831,9 +1850,6 @@ public IEnumerable<FileInfo> EndSynchronizeDirectories(IAsyncResult asyncResult)
18311850

18321851
private IEnumerable<FileInfo> InternalSynchronizeDirectories(string sourcePath, string destinationPath, string searchPattern, SftpSynchronizeDirectoriesAsyncResult asynchResult)
18331852
{
1834-
if (destinationPath.IsNullOrWhiteSpace())
1835-
throw new ArgumentException("destinationPath");
1836-
18371853
if (!Directory.Exists(sourcePath))
18381854
throw new FileNotFoundException(string.Format("Source directory not found: {0}", sourcePath));
18391855

@@ -1909,8 +1925,9 @@ private IEnumerable<FileInfo> InternalSynchronizeDirectories(string sourcePath,
19091925
/// </summary>
19101926
/// <param name="path">The path.</param>
19111927
/// <param name="listCallback">The list callback.</param>
1912-
/// <returns></returns>
1913-
/// <exception cref="System.ArgumentNullException">path</exception>
1928+
/// <returns>
1929+
/// A list of files in the specfied directory.
1930+
/// </returns>
19141931
/// <exception cref="ArgumentNullException"><paramref name="path" /> is <b>null</b>.</exception>
19151932
/// <exception cref="SshConnectionException">Client not connected.</exception>
19161933
private IEnumerable<SftpFile> InternalListDirectory(string path, Action<int> listCallback)

0 commit comments

Comments
 (0)