C# Class com.Sconit.Utility.SocketFtpHelper

Show file Open project: Novthirteen/yfkey-scms

Public Methods

Method Description
BeginChangeDir ( String dirName, System callback ) : System.IAsyncResult
BeginClose ( System callback ) : System.IAsyncResult
BeginDeleteFile ( String fileName, System callback ) : System.IAsyncResult
BeginDownload ( String remFileName, System.Boolean resume, System callback ) : System.IAsyncResult
BeginDownload ( String remFileName, String locFileName, System.Boolean resume, System callback ) : System.IAsyncResult
BeginDownload ( String remFileName, String locFileName, System callback ) : System.IAsyncResult
BeginDownload ( String remFileName, System callback ) : System.IAsyncResult
BeginGetFileList ( String mask, System callback ) : System.IAsyncResult
BeginGetFileList ( System callback ) : System.IAsyncResult
BeginGetFileSize ( String fileName, System callback ) : System.IAsyncResult
BeginLogin ( System callback ) : System.IAsyncResult
BeginMakeDir ( String dirName, System callback ) : System.IAsyncResult
BeginRemoveDir ( String dirName, System callback ) : System.IAsyncResult
BeginRenameFile ( String oldFileName, String newFileName, System.Boolean overwrite, System callback ) : System.IAsyncResult
BeginUpload ( String fileName, System.Boolean resume, System callback ) : System.IAsyncResult
BeginUpload ( String fileName, System callback ) : System.IAsyncResult
BeginUploadDirectory ( String path, System.Boolean recurse, String mask, System callback ) : System.IAsyncResult
BeginUploadDirectory ( String path, System.Boolean recurse, System callback ) : System.IAsyncResult
ChangeDir ( string dirName ) : void

Change the current working directory on the remote FTP server.

Close ( ) : void

Close the FTP connection.

DeleteFile ( string fileName ) : void

Delete a file from the remote FTP server.

Download ( string remFileName ) : void

Download a file to the Assembly's local directory, keeping the same file name.

Download ( string remFileName, System.Boolean resume ) : void

Download a remote file to the Assembly's local directory, keeping the same file name, and set the resume flag.

Download ( string remFileName, string locFileName ) : void

Download a remote file to a local file name which can include a path. The local file name will be created or overwritten, but the path must exist.

Download ( string remFileName, string locFileName, System.Boolean resume ) : void

Download a remote file to a local file name which can include a path, and set the resume flag. The local file name will be created or overwritten, but the path must exist.

GetFileList ( ) : string[]

Return a string array containing the remote directory's file list.

GetFileList ( string mask ) : string[]

Return a string array containing the remote directory's file list.

GetFileSize ( string fileName ) : long

Return the size of a file.

Login ( ) : void

Login to the remote server.

MakeDir ( string dirName ) : void

Create a directory on the remote FTP server.

RemoveDir ( string dirName ) : void

Delete a directory on the remote FTP server.

RenameFile ( string oldFileName, string newFileName, bool overwrite ) : void

Rename a file on the remote FTP server.

SocketFtpHelper ( ) : System

Default contructor

SocketFtpHelper ( string server, string username, string password ) : System

SocketFtpHelper ( string server, string username, string password, int timeoutSeconds, int port ) : System

Upload ( string fileName ) : void

Upload a file.

Upload ( string fileName, bool resume ) : void

Upload a file and set the resume flag.

UploadDirectory ( string path, bool recurse ) : void

Upload a directory and its file contents

UploadDirectory ( string path, bool recurse, string mask ) : void

Upload a directory and its file contents

Private Methods

Method Description
cleanup ( ) : void

Always release those sockets.

createDataSocket ( ) : Socket

when doing data transfers, we need to open another socket for it.

readLine ( ) : string

readResponse ( ) : void

sendCommand ( String command ) : void

Method Details

BeginChangeDir() public method

public BeginChangeDir ( String dirName, System callback ) : System.IAsyncResult
dirName String
callback System
return System.IAsyncResult

BeginClose() public method

public BeginClose ( System callback ) : System.IAsyncResult
callback System
return System.IAsyncResult

BeginDeleteFile() public method

public BeginDeleteFile ( String fileName, System callback ) : System.IAsyncResult
fileName String
callback System
return System.IAsyncResult

BeginDownload() public method

public BeginDownload ( String remFileName, System.Boolean resume, System callback ) : System.IAsyncResult
remFileName String
resume System.Boolean
callback System
return System.IAsyncResult

BeginDownload() public method

public BeginDownload ( String remFileName, String locFileName, System.Boolean resume, System callback ) : System.IAsyncResult
remFileName String
locFileName String
resume System.Boolean
callback System
return System.IAsyncResult

BeginDownload() public method

public BeginDownload ( String remFileName, String locFileName, System callback ) : System.IAsyncResult
remFileName String
locFileName String
callback System
return System.IAsyncResult

BeginDownload() public method

public BeginDownload ( String remFileName, System callback ) : System.IAsyncResult
remFileName String
callback System
return System.IAsyncResult

BeginGetFileList() public method

public BeginGetFileList ( String mask, System callback ) : System.IAsyncResult
mask String
callback System
return System.IAsyncResult

BeginGetFileList() public method

public BeginGetFileList ( System callback ) : System.IAsyncResult
callback System
return System.IAsyncResult

BeginGetFileSize() public method

public BeginGetFileSize ( String fileName, System callback ) : System.IAsyncResult
fileName String
callback System
return System.IAsyncResult

BeginLogin() public method

public BeginLogin ( System callback ) : System.IAsyncResult
callback System
return System.IAsyncResult

BeginMakeDir() public method

public BeginMakeDir ( String dirName, System callback ) : System.IAsyncResult
dirName String
callback System
return System.IAsyncResult

BeginRemoveDir() public method

public BeginRemoveDir ( String dirName, System callback ) : System.IAsyncResult
dirName String
callback System
return System.IAsyncResult

BeginRenameFile() public method

public BeginRenameFile ( String oldFileName, String newFileName, System.Boolean overwrite, System callback ) : System.IAsyncResult
oldFileName String
newFileName String
overwrite System.Boolean
callback System
return System.IAsyncResult

BeginUpload() public method

public BeginUpload ( String fileName, System.Boolean resume, System callback ) : System.IAsyncResult
fileName String
resume System.Boolean
callback System
return System.IAsyncResult

BeginUpload() public method

public BeginUpload ( String fileName, System callback ) : System.IAsyncResult
fileName String
callback System
return System.IAsyncResult

BeginUploadDirectory() public method

public BeginUploadDirectory ( String path, System.Boolean recurse, String mask, System callback ) : System.IAsyncResult
path String
recurse System.Boolean
mask String
callback System
return System.IAsyncResult

BeginUploadDirectory() public method

public BeginUploadDirectory ( String path, System.Boolean recurse, System callback ) : System.IAsyncResult
path String
recurse System.Boolean
callback System
return System.IAsyncResult

ChangeDir() public method

Change the current working directory on the remote FTP server.
public ChangeDir ( string dirName ) : void
dirName string
return void

Close() public method

Close the FTP connection.
public Close ( ) : void
return void

DeleteFile() public method

Delete a file from the remote FTP server.
public DeleteFile ( string fileName ) : void
fileName string
return void

Download() public method

Download a file to the Assembly's local directory, keeping the same file name.
public Download ( string remFileName ) : void
remFileName string
return void

Download() public method

Download a remote file to the Assembly's local directory, keeping the same file name, and set the resume flag.
public Download ( string remFileName, System.Boolean resume ) : void
remFileName string
resume System.Boolean
return void

Download() public method

Download a remote file to a local file name which can include a path. The local file name will be created or overwritten, but the path must exist.
public Download ( string remFileName, string locFileName ) : void
remFileName string
locFileName string
return void

Download() public method

Download a remote file to a local file name which can include a path, and set the resume flag. The local file name will be created or overwritten, but the path must exist.
public Download ( string remFileName, string locFileName, System.Boolean resume ) : void
remFileName string
locFileName string
resume System.Boolean
return void

GetFileList() public method

Return a string array containing the remote directory's file list.
public GetFileList ( ) : string[]
return string[]

GetFileList() public method

Return a string array containing the remote directory's file list.
public GetFileList ( string mask ) : string[]
mask string
return string[]

GetFileSize() public method

Return the size of a file.
public GetFileSize ( string fileName ) : long
fileName string
return long

Login() public method

Login to the remote server.
public Login ( ) : void
return void

MakeDir() public method

Create a directory on the remote FTP server.
public MakeDir ( string dirName ) : void
dirName string
return void

RemoveDir() public method

Delete a directory on the remote FTP server.
public RemoveDir ( string dirName ) : void
dirName string
return void

RenameFile() public method

Rename a file on the remote FTP server.
public RenameFile ( string oldFileName, string newFileName, bool overwrite ) : void
oldFileName string
newFileName string
overwrite bool setting to false will throw exception if it exists
return void

SocketFtpHelper() public method

Default contructor
public SocketFtpHelper ( ) : System
return System

SocketFtpHelper() public method

public SocketFtpHelper ( string server, string username, string password ) : System
server string
username string
password string
return System

SocketFtpHelper() public method

public SocketFtpHelper ( string server, string username, string password, int timeoutSeconds, int port ) : System
server string
username string
password string
timeoutSeconds int
port int
return System

Upload() public method

Upload a file.
public Upload ( string fileName ) : void
fileName string
return void

Upload() public method

Upload a file and set the resume flag.
public Upload ( string fileName, bool resume ) : void
fileName string
resume bool
return void

UploadDirectory() public method

Upload a directory and its file contents
public UploadDirectory ( string path, bool recurse ) : void
path string
recurse bool Whether to recurse sub directories
return void

UploadDirectory() public method

Upload a directory and its file contents
public UploadDirectory ( string path, bool recurse, string mask ) : void
path string
recurse bool Whether to recurse sub directories
mask string Only upload files of the given mask - everything is '*.*'
return void