From af05714f97e2d14a2ad820b54292141eb2544008 Mon Sep 17 00:00:00 2001 From: Kenneth_aa_cp Date: Tue, 1 May 2012 09:22:42 +0000 Subject: [PATCH] Updated documentation for exceptions. --- Renci.SshClient/Renci.SshNet/SftpClient.cs | 182 ++++++++++----------- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/Renci.SshClient/Renci.SshNet/SftpClient.cs b/Renci.SshClient/Renci.SshNet/SftpClient.cs index 85f5314c..cbf36995 100644 --- a/Renci.SshClient/Renci.SshNet/SftpClient.cs +++ b/Renci.SshClient/Renci.SshNet/SftpClient.cs @@ -12,7 +12,7 @@ using System.Diagnostics.CodeAnalysis; namespace Renci.SshNet { /// - /// + /// Implementation of the SSH File Transfer Protocol (SFTP) over SSH. /// public partial class SftpClient : BaseClient { @@ -59,7 +59,7 @@ namespace Renci.SshNet /// Initializes a new instance of the class. /// /// The connection info. - /// is null. + /// is null. public SftpClient(ConnectionInfo connectionInfo) : base(connectionInfo) { @@ -74,8 +74,8 @@ namespace Renci.SshNet /// Connection port. /// Authentication username. /// Authentication password. - /// is null. - /// is invalid, or is null or contains whitespace characters. + /// is null. + /// is invalid. -or- is null or contains whitespace characters. /// is not within and . [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope", Justification = "Disposed in Dispose(bool) method.")] public SftpClient(string host, int port, string username, string password) @@ -90,8 +90,8 @@ namespace Renci.SshNet /// Connection host. /// Authentication username. /// Authentication password. - /// is null. - /// is invalid, or is null or contains whitespace characters. + /// is null. + /// is invalid. -or- is null contains whitespace characters. public SftpClient(string host, string username, string password) : this(host, 22, username, password) { @@ -104,8 +104,8 @@ namespace Renci.SshNet /// Connection port. /// Authentication username. /// Authentication private key file(s) . - /// is null. - /// is invalid, -or- is null or contains whitespace characters. + /// is null. + /// is invalid. -or- is nunullll or contains whitespace characters. /// is not within and . [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope", Justification = "Disposed in Dispose(bool) method.")] public SftpClient(string host, int port, string username, params PrivateKeyFile[] keyFiles) @@ -120,8 +120,8 @@ namespace Renci.SshNet /// Connection host. /// Authentication username. /// Authentication private key file(s) . - /// is null. - /// is invalid, -or- is null or contains whitespace characters. + /// is null. + /// is invalid. -or- is null or contains whitespace characters. public SftpClient(string host, string username, params PrivateKeyFile[] keyFiles) : this(host, 22, username, keyFiles) { @@ -133,9 +133,9 @@ namespace Renci.SshNet /// Changes remote directory to path. /// /// New directory path. - /// is null. + /// is null. /// Client is not connected. - /// Permission to change directory denied by remote host -or- a SSH command was denied by the server. + /// Permission to change directory denied by remote host. -or- A SSH command was denied by the server. /// The path in was not found on the remote host. /// A SSH error where is the message from the remote host. public void ChangeDirectory(string path) @@ -154,9 +154,9 @@ namespace Renci.SshNet /// /// File(s) path, may match multiple files. /// The mode. - /// is null. + /// is null. /// Client is not connected. - /// Permission to change permission on the path(s) was denied by the remote host -or- a SSH command was denied by the server. + /// Permission to change permission on the path(s) was denied by the remote host. -or- A SSH command was denied by the server. /// The path in was not found on the remote host. /// A SSH error where is the message from the remote host. public void ChangePermissions(string path, short mode) @@ -170,9 +170,9 @@ namespace Renci.SshNet /// Creates remote directory specified by path. /// /// Directory path to create. - /// is null or contains whitespace characters. + /// is null or contains whitespace characters. /// Client is not connected. - /// Permission to create the directory was denied by the remote host -or- a SSH command was denied by the server. + /// Permission to create the directory 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. public void CreateDirectory(string path) { @@ -191,9 +191,9 @@ namespace Renci.SshNet /// Deletes remote directory specified by path. /// /// Directory to be deleted path. - /// is null or contains whitespace characters. + /// is null or contains whitespace characters. /// Client is not connected. - /// Permission to delete the directory was denied by the remote host -or- a SSH command was denied by the server. + /// Permission to delete the directory 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. public void DeleteDirectory(string path) { @@ -212,9 +212,9 @@ namespace Renci.SshNet /// Deletes remote file specified by path. /// /// File to be deleted path. - /// is null or contains whitespace characters. + /// is null or contains whitespace characters. /// Client is not connected. - /// Permission to delete the file was denied by the remote host -or- a SSH command was denied by the server. + /// Permission to delete the file 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. public void DeleteFile(string path) { @@ -234,9 +234,9 @@ namespace Renci.SshNet /// /// Path to the old file location. /// Path to the new file location. - /// or is null. + /// is null. -or- or is null. /// Client is not connected. - /// Permission to rename the file was denied by the remote host -or- a SSH command was denied by the server. + /// Permission to rename the file 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. public void RenameFile(string oldPath, string newPath) { @@ -261,9 +261,9 @@ namespace Renci.SshNet /// /// The old path. /// The new path. - /// or is null or contains whitespace characters. + /// is null. -or- is null or contains whitespace characters. /// Client is not connected. - /// Permission to create the symbolic link was denied by the remote host -or- a SSH command was denied by the server. + /// Permission to create the symbolic link 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. public void SymbolicLink(string path, string linkPath) { @@ -288,9 +288,9 @@ namespace Renci.SshNet /// /// The path. /// List of directory entries - /// is null. + /// is null. /// Client is not connected. - /// Permission to list the contents of the directory was denied by the remote host -or- a SSH command was denied by the server. + /// Permission to list the contents of the directory 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. public IEnumerable ListDirectory(string path) { @@ -334,7 +334,7 @@ namespace Renci.SshNet /// /// List of files /// - /// 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. + /// The IAsyncResult object () did not come from the corresponding async method on this type. -or- EndExecute was called multiple times with the same IAsyncResult. public IEnumerable EndListDirectory(IAsyncResult asyncResult) { var ar = asyncResult as SftpListDirectoryAsyncResult; @@ -352,7 +352,7 @@ namespace Renci.SshNet /// The path. /// /// Client is not connected. - /// is null. + /// is null. public SftpFile Get(string path) { if (path == null) @@ -373,9 +373,9 @@ namespace Renci.SshNet /// /// The path. /// true if directory or file exists; otherwise false. - /// is null or contains whitespace characters. + /// is null or contains 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. + /// 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. public bool Exists(string path) { @@ -411,10 +411,10 @@ namespace Renci.SshNet /// /// File to download. /// Stream to write the file into. - /// is null. - /// is null or contains whitespace characters. + /// is null. + /// is null or contains 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. + /// 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. /// Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. public void DownloadFile(string path, Stream output) @@ -430,10 +430,10 @@ namespace Renci.SshNet /// The method to be called when the asynchronous write operation is completed. /// A user-provided object that distinguishes this particular asynchronous write request from other requests. /// An that references the asynchronous operation. - /// is null. - /// is null or contains whitespace characters. + /// is null. + /// is null or contains 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. + /// 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. /// Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. public IAsyncResult BeginDownloadFile(string path, Stream output, AsyncCallback asyncCallback, object state) @@ -470,7 +470,7 @@ namespace Renci.SshNet /// Ends an asynchronous file downloading into the stream. /// /// The pending asynchronous SFTP request. - /// 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. + /// The IAsyncResult object () did not come from the corresponding async method on this type. -or- EndExecute was called multiple times with the same IAsyncResult. public void EndDownloadFile(IAsyncResult asyncResult) { var ar = asyncResult as SftpDownloadAsyncResult; @@ -487,10 +487,10 @@ namespace Renci.SshNet /// /// Data input stream. /// Remote file path. - /// is null. - /// is null or contains whitespace characters. + /// is null. + /// is null or contains whitespace characters. /// Client is not connected. - /// Permission to upload the file was denied by the remote host -or- a SSH command was denied by the server. + /// Permission to upload the file 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. /// Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. public void UploadFile(Stream input, string path) @@ -504,10 +504,10 @@ namespace Renci.SshNet /// Data input stream. /// Remote file path. /// if set to true then existing file will be overwritten. - /// is null. - /// is null or contains whitespace characters. + /// is null. + /// is null or contains whitespace characters. /// Client is not connected. - /// Permission to upload the file was denied by the remote host -or- a SSH command was denied by the server. + /// Permission to upload the file 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. /// /// Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. @@ -532,10 +532,10 @@ namespace Renci.SshNet /// The method to be called when the asynchronous write operation is completed. /// A user-provided object that distinguishes this particular asynchronous write request from other requests. /// An that references the asynchronous operation. - /// is null. - /// is null or contains whitespace characters. + /// is null. + /// is null or contains whitespace characters. /// Client is not connected. - /// Permission to list the contents of the directory was denied by the remote host -or- a SSH command was denied by the server. + /// Permission to list the contents of the directory 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. /// Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. public IAsyncResult BeginUploadFile(Stream input, string path, AsyncCallback asyncCallback, object state) @@ -552,10 +552,10 @@ namespace Renci.SshNet /// The method to be called when the asynchronous write operation is completed. /// A user-provided object that distinguishes this particular asynchronous write request from other requests. /// An that references the asynchronous operation. - /// is null. - /// is null or contains whitespace characters. + /// is null. + /// is null or contains whitespace characters. /// Client is not connected. - /// Permission to list the contents of the directory was denied by the remote host -or- a SSH command was denied by the server. + /// Permission to list the contents of the directory 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. /// Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. public IAsyncResult BeginUploadFile(Stream input, string path, bool canOverride, AsyncCallback asyncCallback, object state) @@ -599,7 +599,7 @@ namespace Renci.SshNet /// Ends an asynchronous uploading the steam into remote file. /// /// The pending asynchronous SFTP request. - /// 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. + /// The IAsyncResult object () did not come from the corresponding async method on this type. -or- EndExecute was called multiple times with the same IAsyncResult. public void EndUploadFile(IAsyncResult asyncResult) { var ar = asyncResult as SftpUploadAsyncResult; @@ -618,7 +618,7 @@ namespace Renci.SshNet /// /// The file to append the lines to. The file is created if it does not already exist. /// The lines to append to the file. - /// or is null. + /// isnull -or- is null. public void AppendAllLines(string path, IEnumerable contents) { if (contents == null) @@ -639,7 +639,7 @@ namespace Renci.SshNet /// The file to append the lines to. The file is created if it does not already exist. /// The lines to append to the file. /// The character encoding to use. - /// , or is null. + /// is null. -or- is null. -or- is null. public void AppendAllLines(string path, IEnumerable contents, Encoding encoding) { if (contents == null) @@ -660,7 +660,7 @@ namespace Renci.SshNet /// /// The file to append the specified string to. /// The string to append to the file. - /// or is null. + /// is null. -or- is null. public void AppendAllText(string path, string contents) { using (var stream = this.AppendText(path)) @@ -676,7 +676,7 @@ namespace Renci.SshNet /// The file to append the specified string to. /// The string to append to the file. /// The character encoding to use. - /// , or is null. + /// is null. -or- is null. -or- is null. public void AppendAllText(string path, string contents, Encoding encoding) { using (var stream = this.AppendText(path, encoding)) @@ -690,7 +690,7 @@ namespace Renci.SshNet /// /// The path to the file to append to. /// A StreamWriter that appends UTF-8 encoded text to an existing file. - /// is null. + /// is null. public StreamWriter AppendText(string path) { return this.AppendText(path, Encoding.UTF8); @@ -704,7 +704,7 @@ namespace Renci.SshNet /// /// A StreamWriter that appends UTF-8 encoded text to an existing file. /// - /// or is null. + /// is null. -or- is null. public StreamWriter AppendText(string path, Encoding encoding) { if (encoding == null) @@ -718,7 +718,7 @@ namespace Renci.SshNet /// /// The path and name of the file to create. /// A that provides read/write access to the file specified in path - /// is null. + /// is null. public SftpFileStream Create(string path) { return new SftpFileStream(this._sftpSession, path, FileMode.Create, FileAccess.ReadWrite); @@ -730,7 +730,7 @@ namespace Renci.SshNet /// The path and name of the file to create. /// The number of bytes buffered for reads and writes to the file. /// A that provides read/write access to the file specified in path - /// is null. + /// is null. public SftpFileStream Create(string path, int bufferSize) { return new SftpFileStream(this._sftpSession, path, FileMode.Create, FileAccess.ReadWrite, bufferSize); @@ -741,7 +741,7 @@ namespace Renci.SshNet /// /// The file to be opened for writing. /// A that writes to the specified file using UTF-8 encoding. - /// is null. + /// is null. public StreamWriter CreateText(string path) { return new StreamWriter(this.OpenWrite(path), Encoding.UTF8); @@ -753,7 +753,7 @@ namespace Renci.SshNet /// The file to be opened for writing. /// The character encoding to use. /// A that writes to the specified file using UTF-8 encoding. - /// is null. + /// is null. public StreamWriter CreateText(string path, Encoding encoding) { return new StreamWriter(this.OpenWrite(path), encoding); @@ -763,7 +763,7 @@ namespace Renci.SshNet /// Deletes the specified file or directory. An exception is not thrown if the specified file does not exist. /// /// The name of the file or directory to be deleted. Wildcard characters are not supported. - /// is null. + /// is null. /// Client is not connected. public void Delete(string path) { @@ -777,7 +777,7 @@ namespace Renci.SshNet /// /// The file or directory for which to obtain access date and time information. /// A structure set to the date and time that the specified file or directory was last accessed. This value is expressed in local time. - /// is null. + /// is null. /// Client is not connected. public DateTime GetLastAccessTime(string path) { @@ -791,7 +791,7 @@ namespace Renci.SshNet /// /// The file or directory for which to obtain access date and time information. /// A structure set to the date and time that the specified file or directory was last accessed. This value is expressed in UTC time. - /// is null. + /// is null. /// Client is not connected. public DateTime GetLastAccessTimeUtc(string path) { @@ -805,7 +805,7 @@ namespace Renci.SshNet /// /// The file or directory for which to obtain write date and time information. /// A structure set to the date and time that the specified file or directory was last written to. This value is expressed in local time. - /// is null. + /// is null. /// Client is not connected. public DateTime GetLastWriteTime(string path) { @@ -819,7 +819,7 @@ namespace Renci.SshNet /// /// The file or directory for which to obtain write date and time information. /// A structure set to the date and time that the specified file or directory was last written to. This value is expressed in UTC time. - /// is null. + /// is null. /// Client is not connected. public DateTime GetLastWriteTimeUtc(string path) { @@ -834,7 +834,7 @@ namespace Renci.SshNet /// The file to open. /// A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. /// An unshared that provides access to the specified file, with the specified mode and access. - /// is null. + /// is null. public SftpFileStream Open(string path, FileMode mode) { return new SftpFileStream(this._sftpSession, path, mode, FileAccess.ReadWrite); @@ -847,7 +847,7 @@ namespace Renci.SshNet /// A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. /// A value that specifies the operations that can be performed on the file. /// An unshared that provides access to the specified file, with the specified mode and access. - /// is null. + /// is null. public SftpFileStream Open(string path, FileMode mode, FileAccess access) { return new SftpFileStream(this._sftpSession, path, mode, access); @@ -858,7 +858,7 @@ namespace Renci.SshNet /// /// The file to be opened for reading. /// A read-only System.IO.FileStream on the specified path. - /// is null. + /// is null. public SftpFileStream OpenRead(string path) { return new SftpFileStream(this._sftpSession, path, FileMode.Open, FileAccess.Read); @@ -869,7 +869,7 @@ namespace Renci.SshNet /// /// The file to be opened for reading. /// A on the specified path. - /// is null. + /// is null. public StreamReader OpenText(string path) { return new StreamReader(this.OpenRead(path), Encoding.UTF8); @@ -880,7 +880,7 @@ namespace Renci.SshNet /// /// The file to be opened for writing. /// An unshared object on the specified path with access. - /// is null. + /// is null. public SftpFileStream OpenWrite(string path) { return new SftpFileStream(this._sftpSession, path, FileMode.OpenOrCreate, FileAccess.Write); @@ -891,7 +891,7 @@ namespace Renci.SshNet /// /// The file to open for reading. /// A byte array containing the contents of the file. - /// is null. + /// is null. public byte[] ReadAllBytes(string path) { using (var stream = this.OpenRead(path)) @@ -907,7 +907,7 @@ namespace Renci.SshNet /// /// The file to open for reading. /// A string array containing all lines of the file. - /// is null. + /// is null. public string[] ReadAllLines(string path) { return this.ReadAllLines(path, Encoding.UTF8); @@ -919,7 +919,7 @@ namespace Renci.SshNet /// The file to open for reading. /// The encoding applied to the contents of the file. /// A string array containing all lines of the file. - /// is null. + /// is null. public string[] ReadAllLines(string path, Encoding encoding) { var lines = new List(); @@ -938,7 +938,7 @@ namespace Renci.SshNet /// /// The file to open for reading. /// A string containing all lines of the file. - /// is null. + /// is null. public string ReadAllText(string path) { return this.ReadAllText(path, Encoding.UTF8); @@ -950,7 +950,7 @@ namespace Renci.SshNet /// The file to open for reading. /// The encoding applied to the contents of the file. /// A string containing all lines of the file. - /// is null. + /// is null. public string ReadAllText(string path, Encoding encoding) { var lines = new List(); @@ -965,7 +965,7 @@ namespace Renci.SshNet /// /// The file to read. /// The lines of the file. - /// is null. + /// is null. public IEnumerable ReadLines(string path) { return this.ReadAllLines(path); @@ -977,7 +977,7 @@ namespace Renci.SshNet /// The file to read. /// The encoding that is applied to the contents of the file. /// The lines of the file. - /// is null. + /// is null. public IEnumerable ReadLines(string path, Encoding encoding) { return this.ReadAllLines(path, encoding); @@ -1032,7 +1032,7 @@ namespace Renci.SshNet /// /// The file to write to. /// The bytes to write to the file. - /// is null. + /// is null. public void WriteAllBytes(string path, byte[] bytes) { using (var stream = this.OpenWrite(path)) @@ -1046,7 +1046,7 @@ namespace Renci.SshNet /// /// The file to write to. /// The lines to write to the file. - /// is null. + /// is null. public void WriteAllLines(string path, IEnumerable contents) { this.WriteAllLines(path, contents, Encoding.UTF8); @@ -1057,7 +1057,7 @@ namespace Renci.SshNet /// /// The file to write to. /// The string array to write to the file. - /// is null. + /// is null. public void WriteAllLines(string path, string[] contents) { this.WriteAllLines(path, contents, Encoding.UTF8); @@ -1069,7 +1069,7 @@ namespace Renci.SshNet /// The file to write to. /// The lines to write to the file. /// The character encoding to use. - /// is null. + /// is null. public void WriteAllLines(string path, IEnumerable contents, Encoding encoding) { using (var stream = this.CreateText(path, encoding)) @@ -1087,7 +1087,7 @@ namespace Renci.SshNet /// The file to write to. /// The string array to write to the file. /// An object that represents the character encoding applied to the string array. - /// is null. + /// is null. public void WriteAllLines(string path, string[] contents, Encoding encoding) { using (var stream = this.CreateText(path, encoding)) @@ -1104,7 +1104,7 @@ namespace Renci.SshNet /// /// The file to write to. /// The string to write to the file. - /// is null. + /// is null. public void WriteAllText(string path, string contents) { using (var stream = this.CreateText(path)) @@ -1119,7 +1119,7 @@ namespace Renci.SshNet /// The file to write to. /// The string to write to the file. /// The encoding to apply to the string. - /// is null. + /// is null. public void WriteAllText(string path, string contents, Encoding encoding) { using (var stream = this.CreateText(path, encoding)) @@ -1133,7 +1133,7 @@ namespace Renci.SshNet /// /// The path to the file. /// The of the file on the path. - /// is null. + /// is null. public SftpFileAttributes GetAttributes(string path) { var fullPath = this._sftpSession.GetCanonicalPath(path); @@ -1146,7 +1146,7 @@ namespace Renci.SshNet /// /// The path to the file. /// The desired . - /// is null. + /// is null. public void SetAttributes(string path, SftpFileAttributes fileAttributes) { var fullPath = this._sftpSession.GetCanonicalPath(path); @@ -1165,7 +1165,7 @@ namespace Renci.SshNet #endregion - /// is null. + /// is null. /// Client not connected. private IEnumerable InternalListDirectory(string path, SftpListDirectoryAsyncResult asynchResult) { @@ -1206,8 +1206,8 @@ namespace Renci.SshNet return result; } - /// is null or contains whitespace. - /// is null. + /// is null or contains whitespace. + /// is null. /// Client not connected. private void InternalDownloadFile(string path, Stream output, SftpDownloadAsyncResult asynchResult) { @@ -1249,8 +1249,8 @@ namespace Renci.SshNet this._sftpSession.RequestClose(handle); } - /// is null. - /// is null or contains whitespace. + /// is null. + /// is null or contains whitespace. /// Client not connected. private void InternalUploadFile(Stream input, string path, SftpUploadAsyncResult asynchResult, Flags flags) {