FileTransferClient Class
Namespace: Rebex.Net
Assembly: Rebex.FileTransfer.dll (version 7.0.9448)
This class is based on IFtp interface and provide common functionality for FTP, FTP/SSL and SFTP protocols.
Syntax
public class FileTransferClient : NetworkSession, ILogWriterProvider, IFtp, IDisposable
Inherited Members
Constructors
| Name | Description |
|---|---|
| FileTransferClient() | Creates new instance of FileTransferClient class. |
Properties
| Name | Description |
|---|---|
| DefaultLogWriter | Gets or sets a default log writer used by all new instances of NetworkSession object. Inherited from NetworkSession. |
| Encoding | Gets or sets the Encoding to use to encode and decode command parameters and server responses. |
| Fingerprint | Gets the server public key fingerprint (for SFTP) or the server certificate thumbprint (for FTP/SSL). |
| FtpPassiveMode | Gets or sets a value which specifies the way data transfers are made. This is used only when FTP protocol is used. |
| FtpTransferMode | Gets or sets the data transfer mode. This is used only when FTP protocol is used. |
| Inner | Gets the inner protocol client. It can be Ftp or Sftp class instance. This is based on Connect method parameter. |
| InstanceId | Gets instance ID (intended for logging purposes). Inherited from NetworkSession. |
| IsAuthenticated | Gets a value indicating whether the session is authenticated. |
| IsBusy | Gets a value indicating whether there any operation (method) in progress. This is used only when FTP protocol is used. |
| IsConnected | Gets a value indicating whether the session is connected. |
| IsSecured | Gets the value indicating whether the control connection is secured. |
| LocalEndPoint | Gets the local client EndPoint. |
| LogWriter | Gets or sets the LogWriter used by this object. Inherited from NetworkSession. |
| MaxDownloadSpeed | Gets or sets the maximum allowed download speed, in kilobytes. For unlimited speed, set this to zero. |
| MaxUploadSpeed | Gets or sets the maximum allowed upload speed, in kilobytes. For unlimited speed, set this to zero. |
| Proxy | Gets or sets the network proxy to use to access a remote server. |
| RemoteEndPoint | Gets the remote server EndPoint. |
| ServerName | Gets the server name, if available. |
| ServerPort | Gets the server port, if available. |
| Settings | Gets the options set used by this object. |
| SshSession | Gets the SSH session used by the SFTP part of the client. |
| Timeout | Gets or sets the length of time in milliseconds before the operation times out (specify -1 or 0 to indicate that the request does not time out). |
| TransferType | Gets or sets the data transfer type. |
| UserName | Gets the authenticated user name, if available. |
Methods
| Name | Description |
|---|---|
| Abort() | Abort pending operations. |
| ChangeDirectory(String) | Changes the current working directory on the server. |
| ChangeDirectoryAsync(String, Object) | Changes the current working directory on the server. |
| CheckConnectionState() | Checks whether the session is still connected. Throws an exception on error. |
| Connect(String, FileTransferMode) | Connects to the server using chosen protocol. |
| Connect(String, Int32, FileTransferMode) | Connects to the server using chosen protocol. |
| ConnectAsync(String, FileTransferMode, Object) | Begins asynchronous Connect operation. Connects to the server using chosen protocol. |
| ConnectAsync(String, Int32, FileTransferMode, Object) | Begins asynchronous Connect operation. Connects to the server using chosen protocol. |
| CreateDirectory(String) | Creates a directory on the server. |
| CreateDirectoryAsync(String, Object) | Creates a directory on the server. |
| Delete(FileSet) | Deletes specified files and/or directories on the server. |
| Delete(String, TraversalMode) | Deletes specified files and/or directories on the server. Accepts wildcards. |
| DeleteAsync(FileSet, Object) | Deletes specified files and/or directories on the server. |
| DeleteAsync(String, TraversalMode, Object) | Deletes specified files and/or directories on the server. Accepts wildcards. |
| DeleteFile(String) | Deletes a file on the server. |
| DeleteFileAsync(String, Object) | Deletes a file on the server. |
| DirectoryExists(String) | Detects whether the specified directory exists on the server. |
| DirectoryExistsAsync(String, Object) | Detects whether the specified directory exists on the server. |
| Disconnect() | Informs the server that the connection is about to close and terminates the connection. |
| DisconnectAsync(Object) | Informs the server that the connection is about to close and terminates the connection. |
| Dispose() | Disposes the object. After calling this the inner instance will be disposed as well and Inner will be set to null. |
| Download(FileSet, String) | Downloads the specified files and/or directories from the server to the local directory. |
| Download(FileSet, String, TransferMethod, ActionOnExistingFiles) | Downloads the specified files and/or directories from the server to the local directory. |
| Download(String, String) | Downloads the specified file or directory hierarchy from the server to the local directory. Accepts wildcards. |
| Download(String, String, TraversalMode) | Downloads the specified file or directory hierarchy from the server to the local directory. Accepts wildcards. |
| Download(String, String, TraversalMode, TransferMethod, ActionOnExistingFiles) | Downloads the specified file or directory hierarchy from the server to the local directory. Accepts wildcards. |
| DownloadAsync(FileSet, String, TransferMethod, ActionOnExistingFiles, Object) | Downloads the specified files and/or directories from the server to the local directory. |
| DownloadAsync(String, String, TraversalMode, TransferMethod, ActionOnExistingFiles, Object) | Downloads the specified file or directory hierarchy from the server to the local directory. Accepts wildcards. |
| FileExists(String) | Detects whether the specified file exists on the server. |
| FileExistsAsync(String, Object) | Detects whether the specified file exists on the server. |
| GetChecksum(String, ChecksumAlgorithm) | Returns the checksum of the specified file on the server. |
| GetChecksum(String, ChecksumAlgorithm, Int64, Int64) | Returns the checksum of the specified file on the server. |
| GetCurrentDirectory() | Gets the absolute path of the current working directory on the remote server. |
| GetCurrentDirectoryAsync(Object) | Gets the absolute path of the current working directory on the remote server. |
| GetDownloadStream(String) | Returns a Stream for reading data from the remote file. |
| GetDownloadStream(String, SeekOrigin, Int64) | Returns a Stream for reading data from the remote file. |
| GetDownloadStreamAsync(String, SeekOrigin, Int64, Object) | Returns a Stream for reading data from the remote file. |
| GetFile(String, Stream) | Downloads the remote file to the data stream. |
| GetFile(String, Stream, Int64) | Downloads the specified part of the remote file to the data stream. |
| GetFile(String, String) | Downloads the remote file to the local file, overriding it if it already exists. |
| GetFile(String, String, Int64, Int64) | Downloads the specified part of the remote file to the specified offset of the local file. |
| GetFileAsync(String, Stream, Int64, Object) | Downloads the specified part of the remote file to the data stream. |
| GetFileAsync(String, Stream, Object) | Downloads the specified emote file to the data stream. |
| GetFileAsync(String, String, Int64, Int64, Object) | Downloads the specified part of the remote file to the specified offset of the local file. |
| GetFileAsync(String, String, Object) | Downloads the remote file to the specified local file. |
| GetFileDateTime(String) | Retrieves the modification date and time of the specified remote file. |
| GetFileDateTimeAsync(String, Object) | Retrieves the modification date and time of the specified remote file. |
| GetFileLength(String) | Retrieves the size of the specified remote file. |
| GetFileLengthAsync(String, Object) | Retrieves the size of the specified remote file. |
| GetHashCode() | Gets hash code for this object. Inherited from NetworkSession. |
| GetInfo(String, Boolean) | Retrieves a FileSystemItem containing the information about the specified remote file or directory. |
| GetInfoAsync(String, Boolean, Object) | Retrieves a FileSystemItem containing the information about the specified remote file or directory. |
| GetItems(FileSet) | Retrieves the list of files and directories specified by the |
| GetItems(String) | Retrieves the list of files and directories. Matching directories are searched recursively. |
| GetItems(String, TraversalMode) | Retrieves the list of files and directories. |
| GetItemsAsync(FileSet, Object) | Retrieves the list of files and directories specified by the |
| GetItemsAsync(String, TraversalMode, Object) | Retrieves the list of files and directories. |
| GetList() | Retrieves the list of files and directories in the current server directory. |
| GetList(String) | Retrieves the list of files and directories in the current server directory. |
| GetListAsync(Object) | Retrieves the list of files and directories in the current server directory. |
| GetListAsync(String, Object) | Retrieves the list of files and directories in the current server directory. |
| GetNameList() | Retrieves the list of file and directory names in the current remote directory. |
| GetNameList(String) | Retrieves the list of file and directory names. |
| GetNameListAsync(Object) | Retrieves the list of file and directory names. |
| GetNameListAsync(String, Object) | Retrieves the list of file and directory names. |
| GetRawList() | Retrieves the raw list of files and directories in the current remote directory using a raw text format. |
| GetRawList(String) | Retrieves the raw list of files and directories using a raw text format. |
| GetRawListAsync(Object) | Retrieves the raw list of files and directories using a raw text format. |
| GetRawListAsync(String, Object) | Retrieves the raw list of files and directories using a raw text format. |
| GetUploadStream(String) | Returns a Stream for writing data to the remote file. |
| GetUploadStream(String, SeekOrigin, Int64) | Returns a Stream for writing data to the remote file. |
| GetUploadStreamAsync(String, SeekOrigin, Int64, Object) | Returns a Stream for writing data to the remote file. |
| KeepAlive() | Sends a command to the server to keep the connection alive. |
| KeepAliveAsync(Object) | Sends a command to the server to keep the connection alive. |
| Login(SshGssApiCredentials) | Authenticates to the server using GSSAPI. Kerberos (not on .NET CF) and NTLM methods are supported. This method cannot be used with FTP protocol. |
| Login(String, SshAuthenticationAgent) | Authenticates the user to the server using his private key and initializes the SFTP session. This method cannot be used with FTP protocol. |
| Login(String, SshPrivateKey) | Authenticates the user to the server using his private key and initializes the SFTP session. |
| Login(String, String) | Authenticates the user to the server. |
| Login(String, String, SshAuthenticationAgent) | Authenticates the user to the server using a combination of password and public key and initializes the SFTP session. This method cannot be used with FTP protocol. |
| Login(String, String, SshPrivateKey) | Authenticates the user to the server using a combination of password and public key and initializes the SFTP session. This method cannot be used with FTP protocol. |
| Login(String, String, String) | Authenticates the user to the FTP server. This method cannot be used with SFTP protocol. |
| LoginAsync(SshGssApiCredentials, Object) | Authenticates to the server using GSSAPI. Kerberos (not on .NET CF) and NTLM methods are supported. This method cannot be used with FTP protocol. |
| LoginAsync(String, SshAuthenticationAgent, Object) | Asynchronously authenticates the user to the server using his private key and initializes the SFTP session. This method cannot be used with FTP protocol. |
| LoginAsync(String, SshPrivateKey, Object) | Begins asynchronous Login operation. Authenticates the user to the server using his private key and initializes the SFTP session. |
| LoginAsync(String, String, SshAuthenticationAgent, Object) | Asynchronously authenticates the user to the server using a combination of password and public key and initializes the SFTP session. This method cannot be used with FTP protocol. |
| LoginAsync(String, String, SshPrivateKey, Object) | Begins asynchronous Login operation. Authenticates the user to the server using a combination of password and public key and initializes the SFTP session. This method cannot be used with FTP protocol. |
| LoginAsync(String, String, Object) | Begins asynchronous Login operation. Authenticates the user to the server. |
| LoginAsync(String, String, String, Object) | Begins asynchronous Login operation. Authenticates the user to the FTP server. This method cannot be used with SFTP protocol. |
| PutFile(Stream, String) | Uploads the content of the data stream to the file on the server, overriding it if it already exists. |
| PutFile(Stream, String, Int64, Int64) | Uploads the content of the data stream to the specified offset of the file on the server. |
| PutFile(String, String) | Uploads the content of the local file to the file on the server, overriding it if it already exists. |
| PutFile(String, String, Int64, Int64, Int64) | Uploads the specified part of the local file to the specified offset of the file on the server. |
| PutFileAsync(Stream, String, Int64, Int64, Object) | Uploads the content of the data stream to the specified offset of the file on the server. |
| PutFileAsync(Stream, String, Object) | Uploads the content of the data stream to the specified offset of the file on the server. |
| PutFileAsync(String, String, Int64, Int64, Int64, Object) | Uploads the specified part of the local file to the specified offset of the file on the server. |
| PutFileAsync(String, String, Object) | Uploads the specified part of the local file to the specified offset of the file on the server. |
| RemoveDirectory(String) | Deletes an empty remote directory with the specified pathname. |
| RemoveDirectoryAsync(String, Object) | Deletes an empty remote directory with the specified pathname. |
| Rename(String, String) | Renames or moves a file or directory on the server. |
| RenameAsync(String, String, Object) | Renames a file or directory on the server. |
| SetFileDateTime(String, DateTime) | Sets the modification date and time of the specified remote file. |
| SetFileDateTimeAsync(String, DateTime, Object) | Sets the modification date and time of the specified remote file. |
| SetSocketFactory(ISocketFactory) | Sets the socket factory to be used to create communication sockets. |
| Upload(FileSet, String) | Uploads the specified local files and/or directories to the directory to the server. |
| Upload(FileSet, String, TransferMethod, ActionOnExistingFiles) | Uploads the specified local files and/or directories to the directory to the server. |
| Upload(String, String) | Uploads the specified file or directory hierarchy to the directory on the server. Accepts wildcards. |
| Upload(String, String, TraversalMode) | Uploads the specified file or directory hierarchy to the directory on the server. Accepts wildcards. |
| Upload(String, String, TraversalMode, TransferMethod, ActionOnExistingFiles) | Uploads the specified file or directory hierarchy to the directory on the server. Accepts wildcards. |
| UploadAsync(FileSet, String, TransferMethod, ActionOnExistingFiles, Object) | Uploads the specified local files and/or directories to the directory to the server. |
| UploadAsync(String, String, TraversalMode, TransferMethod, ActionOnExistingFiles, Object) | Uploads the specified file or directory hierarchy to the directory on the server. Accepts wildcards. |
Events
| Name | Description |
|---|---|
| DeleteProgressChanged | Occurs when a significant action occurs in Delete(String, TraversalMode) method. Notifies the client about currently processing directory, currently deleting file and progress of the delete. |
| FingerprintCheck | Occurs when a fingerprint is received from the server and needs to be validated. |
| ListItemReceived | Occurs when a file and directory listing item is received by the GetList(), GetRawList(), GetNameList() or GetItems(String) methods. Notifies the client about currently processed item. |
| ProblemDetected | Occurs when a problem is detected in Download(String, String), Upload(String, String), Delete(String, TraversalMode) or GetItems(String) methods, making it possible for the handler to choose a desired reaction. |
| TransferProgressChanged | Occurs when a significant action occurs in Download(String, String), Upload(String, String) methods. Notifies the client about currently processing directory, currently transferring file and progress of the transfer. |
| Traversing | Occurs when a significant action occurs in Download(String, String), Upload(String, String), Delete(String, TraversalMode) or GetItems(String) methods. Notifies the client about traversing hierarchy structure. |
| ValidatingCertificate | Occurs when an FTP/SSL server certificate needs to be validated. |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IFtp.Settings | Gets the options set used by this object. |