com.enterprisedt.net.ftp
Class AsyncFileTransferClient

java.lang.Object
  extended by com.enterprisedt.net.ftp.SecureFileTransferClient
      extended by com.enterprisedt.net.ftp.AsyncFileTransferClient
All Implemented Interfaces:
FileTransferClientInterface

public class AsyncFileTransferClient
extends SecureFileTransferClient

FTP client class supporting multiple protocols that permits asynchronous FTP operations. Together with the connection pool inherited from SecureFileTransferClient, this means that multiple simultaneous file transfers can be performed in the background.

A simple example of connecting asynchronously is shown below. The MyConnectTest class is implementing the callback, passing itself via the 'this' reference into connectAsync():

 public class MyConnectTest implements Connect {
 
  private AsyncFileTransferClient client = new AsyncFileTransferClient();
 
  public void startConnecting() {
    client.setRemoteHost(host);
    client.setUserName(user);
    client.setPassword(password);
    client.connectAsync(this, null);
  }
 
  public void onConnect(ConnectResult result)
    throws FTPException, IOException {
    result.endAsync();
    System.out.println("Connected!")
  }
 
Users should note that calling asyncConnect() starts a pool of worker threads and the connection pool. This means that asyncDisconnect() (or disconnect()) must be called to stop the worker threads, otherwise applications will hang on exit as threads will still be alive.

Version:
$Revision: 1.8 $
Author:
Bruce Blackshaw

Field Summary
 
Fields inherited from class com.enterprisedt.net.ftp.SecureFileTransferClient
activeTransferTasks, advancedFTPSettings, advancedSettings, advancedSSHSettings, advancedSSLSettings, asyncImpl, eventListener, masterContext, multiSettings, statistics
 
Constructor Summary
AsyncFileTransferClient()
          Default constructor.
AsyncFileTransferClient(int initialPoolSize, int maxPoolSize)
          Constructor.
 
Method Summary
 ChangeDirectoryResult changeDirectoryAsync(java.lang.String directoryName, AsyncCallback.ChangeDirectory callback, java.lang.Object tag)
          Change directory on the FTP server asynchronously.
 ChangeDirectoryResult changeToParentDirectoryAsync(AsyncCallback.ChangeDirectory callback, java.lang.Object tag)
          Change directory on the FTP server asynchronously.
 ConnectResult connectAsync(AsyncCallback.Connect callback, java.lang.Object tag)
          Make an asynchronous connection to the FTP server.
 CreateDirectoryResult createDirectoryAsync(java.lang.String directoryName, AsyncCallback.CreateDirectory callback, java.lang.Object tag)
          Change directory on the FTP server asynchronously.
 DeleteDirectoryResult deleteDirectoryAsync(java.lang.String directoryName, AsyncCallback.DeleteDirectory callback, java.lang.Object tag)
          Delete a directory on the FTP server asynchronously.
 DeleteDirectoryResult deleteDirectoryAsync(java.lang.String directoryName, boolean recursive, AsyncCallback.DeleteDirectory callback, java.lang.Object tag)
          Delete a directory on the FTP server asynchronously, and optionally sub-directories.
 DeleteFileResult deleteFileAsync(java.lang.String remoteFileName, AsyncCallback.DeleteFile callback, java.lang.Object tag)
          Deletes a remote file asynchronously.
 DeleteMultipleFilesResult deleteMultipleFilesAsync(java.io.FileFilter filter, AsyncCallback.DeleteMultipleFiles callback, java.lang.Object tag)
          Deletes remote files in the current directory that match the supplied wildcard
 DeleteMultipleFilesResult deleteMultipleFilesAsync(java.lang.String wildcard, AsyncCallback.DeleteMultipleFiles callback, java.lang.Object tag)
          Deletes remote files in the current directory that match the supplied wildcard
 DeleteMultipleFilesResult deleteMultipleFilesAsync(java.lang.String remoteDirectory, java.io.FileFilter filter, boolean recursive, AsyncCallback.DeleteMultipleFiles callback, java.lang.Object tag)
          Deletes remote files that match the supplied wildcard in the supplied remote directory asynchronously.
 DeleteMultipleFilesResult deleteMultipleFilesAsync(java.lang.String remoteDirectory, java.lang.String wildcard, boolean recursive, AsyncCallback.DeleteMultipleFiles callback, java.lang.Object tag)
          Deletes remote files that match the supplied wildcard in the supplied remote directory asynchronously.
 DirectoryListResult directoryListAsync(java.lang.String directoryName, AsyncCallback.DirectoryList callback, java.lang.Object tag)
          List a directory on the FTP server asynchronously.
 DirectoryNameListResult directoryNameListAsync(java.lang.String directoryName, boolean isLongListing, AsyncCallback.DirectoryNameList callback, java.lang.Object tag)
          List a directory on the FTP server asynchronously.
 DisconnectResult disconnectAsync(AsyncCallback.Disconnect callback, java.lang.Object tag)
          Disconnect from the FTP server asynchronously.
 DisconnectResult disconnectAsync(boolean immediate, AsyncCallback.Disconnect callback, java.lang.Object tag)
          Disconnect from the FTP server asynchronously.
 DownloadByteArrayResult downloadByteArrayAsync(java.lang.String remoteFileName, AsyncCallback.DownloadByteArray callback, java.lang.Object tag)
          Download a file from the FTP server asynchronously to a byte array
 DownloadFileResult downloadFileAsync(java.lang.String localFileName, java.lang.String remoteFileName, WriteMode writeMode, AsyncCallback.DownloadFile callback, java.lang.Object tag)
          Download a file from the FTP server asynchronously.
 DownloadMultipleResult downloadMultipleAsync(java.lang.String localDir, java.io.FileFilter filter, AsyncCallback.DownloadMultiple callback, java.lang.Object tag)
          Downloads remote files to the supplied local directory that match the supplied wildcard from the current remote directory.
 DownloadMultipleResult downloadMultipleAsync(java.lang.String localDir, java.lang.String wildcard, AsyncCallback.DownloadMultiple callback, java.lang.Object tag)
          Downloads remote files to the supplied local directory that match the supplied wildcard from the current remote directory.
 DownloadMultipleResult downloadMultipleAsync(java.lang.String localDir, java.lang.String remoteDir, java.io.FileFilter filter, boolean recursive, AsyncCallback.DownloadMultiple callback, java.lang.Object tag)
          Downloads remote files to the supplied local directory that match the supplied wildcard from the current remote directory.
 DownloadMultipleResult downloadMultipleAsync(java.lang.String localDir, java.lang.String remoteDir, java.lang.String wildcard, boolean recursive, AsyncCallback.DownloadMultiple callback, java.lang.Object tag)
          Downloads remote files to the supplied local directory that match the supplied wildcard from the current remote directory.
 DownloadStreamResult downloadStreamAsync(java.lang.String remoteFileName, AsyncCallback.DownloadStream callback, java.lang.Object tag)
          Download a file from the FTP server as a stream, asynchronously.
 ExecuteCommandResult executeCommandAsync(java.lang.String command, AsyncCallback.ExecuteCommand callback, java.lang.Object tag)
          Request that the remote server execute the literal command supplied.
 ExistsResult existsAsync(java.lang.String remoteFileName, AsyncCallback.Exists callback, java.lang.Object tag)
          Determine asynchronously if a remote file exists.
 FTPTransferType getContentType()
          Get the current content type.
 AsyncCallback.Disconnect getDisconnectCallback()
          Get the currently set disconnect callback.
 ModifiedTimeResult getModifiedTimeAsync(java.lang.String remoteFileName, AsyncCallback.GetModifiedTime callback, java.lang.Object tag)
          Get the modified-time of a remote file asynchronously.
 SizeResult getSizeAsync(java.lang.String remoteFileName, AsyncCallback.Size callback, java.lang.Object tag)
          Get the size of a remote file asynchronously.
 GetSystemTypeResult getSystemTypeAsync(AsyncCallback.GetSystemType callback, java.lang.Object tag)
          Get a string that represents the remote system that the client is logged into.
 boolean isDetectContentType()
          Get the detect content type flag.
 RenameResult renameAsync(java.lang.String renameFromName, java.lang.String renameToName, AsyncCallback.Rename callback, java.lang.Object tag)
          Rename a remote file asynchronously.
 void setContentType(FTPTransferType type)
          Set the transfer type, either ASCII or binary.
 void setDetectContentType(boolean detectContentType)
          Set auto detect of filetypes on or off.
 void setDisconnectCallback(AsyncCallback.Disconnect callback)
          Set the callback that is called for all disconnects - deliberate and resulting from timeout or error.
 ModifiedTimeResult setModifiedTimeAsync(java.lang.String remoteFileName, java.util.Date modifiedTime, AsyncCallback.SetModifiedTime callback, java.lang.Object tag)
          Set the modified-time of a remote file asynchronously.
 UploadByteArrayResult uploadByteArrayAsync(byte[] bytes, java.lang.String remoteFileName, WriteMode writeMode, AsyncCallback.UploadByteArray callback, java.lang.Object tag)
          Upload a byte array to the FTP server asynchronously.
 UploadFileResult uploadFileAsync(java.lang.String localFileName, java.lang.String remoteFileName, AsyncCallback.UploadFile callback, java.lang.Object tag)
          Upload a file to the FTP server asynchronously.
 UploadFileResult uploadFileAsync(java.lang.String localFileName, java.lang.String remoteFileName, WriteMode writeMode, AsyncCallback.UploadFile callback, java.lang.Object tag)
          Upload a file to the FTP server asynchronously.
 UploadMultipleResult uploadMultipleAsync(java.lang.String localDir, java.io.FileFilter filter, AsyncCallback.UploadMultiple callback, java.lang.Object tag)
          Uploads local files from the supplied local directory that match the supplied FileFilter into the current remote directory.
 UploadMultipleResult uploadMultipleAsync(java.lang.String localDir, java.lang.String wildcard, AsyncCallback.UploadMultiple callback, java.lang.Object tag)
          Uploads local files from the supplied local directory that match the supplied wildcard into the current remote directory.
 UploadMultipleResult uploadMultipleAsync(java.lang.String localDir, java.lang.String remoteDir, java.io.FileFilter filter, boolean recursive, AsyncCallback.UploadMultiple callback, java.lang.Object tag)
          Uploads local files from the supplied local directory that match the supplied wildcard into the supplied remote directory.
 UploadMultipleResult uploadMultipleAsync(java.lang.String localDir, java.lang.String remoteDir, java.lang.String wildcard, boolean recursive, AsyncCallback.UploadMultiple callback, java.lang.Object tag)
          Uploads local files from the supplied local directory that match the supplied wildcard into the supplied remote directory.
 UploadStreamResult uploadStreamAsync(java.lang.String remoteFileName, AsyncCallback.UploadStream callback, java.lang.Object tag)
          Upload a file to the FTP server by writing to a stream, asynchronously.
 UploadStreamResult uploadStreamAsync(java.lang.String remoteFileName, WriteMode writeMode, AsyncCallback.UploadStream callback, java.lang.Object tag)
          Upload a file to the FTP server by writing to a stream, asynchronously.
 
Methods inherited from class com.enterprisedt.net.ftp.SecureFileTransferClient
addErrorListener, cancelAllTransfers, changeDirectory, changeToParentDirectory, checkConnection, connect, createDirectory, deleteDirectory, deleteDirectory, deleteFile, deleteMultipleFiles, deleteMultipleFiles, deleteMultipleFiles, deleteMultipleFiles, directoryList, directoryList, directoryNameList, directoryNameList, disconnect, disconnect, downloadByteArray, downloadFile, downloadFile, downloadMultiple, downloadMultiple, downloadMultiple, downloadMultiple, downloadStream, executeCommand, exists, finalize, getAdvancedFTPSettings, getAdvancedSettings, getAdvancedSSHSettings, getAdvancedSSLSettings, getInitialRemoteDirectory, getModifiedTime, getMultipleTransferSettings, getPassword, getProtocol, getRemoteDirectory, getRemoteHost, getRemotePort, getSize, getStatistics, getSystemType, getTimeout, getUserName, isConnected, isServerValidationEnabled, loadSSHServerValidation, loadSSLServerValidation, rename, setEventListener, setInitialRemoteDirectory, setModifiedTime, setPassword, setProtocol, setRemoteHost, setRemotePort, setServerValidationEnabled, setTimeout, setUserName, shutdown, uploadByteArray, uploadFile, uploadFile, uploadMultiple, uploadMultiple, uploadMultiple, uploadMultiple, uploadStream, uploadStream
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncFileTransferClient

public AsyncFileTransferClient(int initialPoolSize,
                               int maxPoolSize)
Constructor. Initialises the class.

Parameters:
poolsize - size of connection pool (i.e. number of managed connections)

AsyncFileTransferClient

public AsyncFileTransferClient()
Default constructor. Uses defaults for pool sizes.

Method Detail

setContentType

public void setContentType(FTPTransferType type)
                    throws java.io.IOException,
                           FTPException
Set the transfer type, either ASCII or binary. Setting applies to all subsequent transfers that are initiated. It does not apply to transfers currently in progress.If called within a callback, will only apply to the callback context, not to all connections.

Specified by:
setContentType in interface FileTransferClientInterface
Overrides:
setContentType in class SecureFileTransferClient
Parameters:
type - transfer type
Throws:
FTPException
java.io.IOException
FTPException

getContentType

public FTPTransferType getContentType()
Get the current content type. If called within a callback, will only apply to the callback context, not to all connections.

Specified by:
getContentType in interface FileTransferClientInterface
Overrides:
getContentType in class SecureFileTransferClient
Returns:
transfer type

setDetectContentType

public void setDetectContentType(boolean detectContentType)
Set auto detect of filetypes on or off. If on, the transfer mode is switched from ASCII to binary and vice versa depending on the extension of the file. After the transfer, the mode is always returned to what it was before the transfer was performed. The default is off. If called within a callback, will only apply to the callback context, not to all connections. If the filetype is unknown, the transfer mode is unchanged

Specified by:
setDetectContentType in interface FileTransferClientInterface
Overrides:
setDetectContentType in class SecureFileTransferClient
Parameters:
detectContentType - true if detecting content type, false if not

isDetectContentType

public boolean isDetectContentType()
Get the detect content type flag. If called within a callback, will only apply to the callback context, not to all connections.

Specified by:
isDetectContentType in interface FileTransferClientInterface
Overrides:
isDetectContentType in class SecureFileTransferClient
Returns:
true if we are detecting binary and ASCII transfers from the file type

connectAsync

public ConnectResult connectAsync(AsyncCallback.Connect callback,
                                  java.lang.Object tag)
                           throws FTPException
Make an asynchronous connection to the FTP server. A number of connections are made - that number being equal to the size of the FTP connection pool.

Parameters:
callback - callback to be notified when connection is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback). Can be set to null.
Returns:
result object
Throws:
FTPException

executeCommandAsync

public ExecuteCommandResult executeCommandAsync(java.lang.String command,
                                                AsyncCallback.ExecuteCommand callback,
                                                java.lang.Object tag)
                                         throws FTPException
Request that the remote server execute the literal command supplied. In FTP and SFTP, this might be a SITE command, while in SFTP it might be a shell command.

It is up to the user to send a sensible command.

Parameters:
command - command string
Returns:
result string by server
Throws:
FTPException
java.io.IOException

getSystemTypeAsync

public GetSystemTypeResult getSystemTypeAsync(AsyncCallback.GetSystemType callback,
                                              java.lang.Object tag)
                                       throws FTPException
Get a string that represents the remote system that the client is logged into.

Parameters:
command - command string
Returns:
result string by server
Throws:
FTPException
java.io.IOException

directoryNameListAsync

public DirectoryNameListResult directoryNameListAsync(java.lang.String directoryName,
                                                      boolean isLongListing,
                                                      AsyncCallback.DirectoryNameList callback,
                                                      java.lang.Object tag)
                                               throws FTPException
List a directory on the FTP server asynchronously.

Parameters:
directoryName - name of the directory (generally not a path)
isLongListing - true if the listing is a long format listing
callback - callback to be notified when connection is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

directoryListAsync

public DirectoryListResult directoryListAsync(java.lang.String directoryName,
                                              AsyncCallback.DirectoryList callback,
                                              java.lang.Object tag)
                                       throws FTPException
List a directory on the FTP server asynchronously.

Parameters:
directoryName - name of the directory (generally not a path)
callback - callback to be notified when connection is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

downloadByteArrayAsync

public DownloadByteArrayResult downloadByteArrayAsync(java.lang.String remoteFileName,
                                                      AsyncCallback.DownloadByteArray callback,
                                                      java.lang.Object tag)
                                               throws FTPException
Download a file from the FTP server asynchronously to a byte array

Parameters:
remoteFileName - name of the remote file to be downloaded
callback - callback to be notified when download is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

downloadFileAsync

public DownloadFileResult downloadFileAsync(java.lang.String localFileName,
                                            java.lang.String remoteFileName,
                                            WriteMode writeMode,
                                            AsyncCallback.DownloadFile callback,
                                            java.lang.Object tag)
                                     throws FTPException
Download a file from the FTP server asynchronously.

Parameters:
localFileName - name (or full path) of the local file to be downloaded to
remoteFileName - name of the remote file to be downloaded
callback - callback to be notified when connection is completed
writeMode - mode in which the file is written to the server
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

downloadStreamAsync

public DownloadStreamResult downloadStreamAsync(java.lang.String remoteFileName,
                                                AsyncCallback.DownloadStream callback,
                                                java.lang.Object tag)
                                         throws FTPException
Download a file from the FTP server as a stream, asynchronously.

Parameters:
remoteFileName - name of the remote file to be downloaded
callback - callback to be notified when connection is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

uploadFileAsync

public UploadFileResult uploadFileAsync(java.lang.String localFileName,
                                        java.lang.String remoteFileName,
                                        AsyncCallback.UploadFile callback,
                                        java.lang.Object tag)
                                 throws FTPException
Upload a file to the FTP server asynchronously. If a null is supplied as the remoteFileName, the STOU (store unique) FTP feature will be used (if available) and the FTP server will generate a unique name for the file. This name can be obtained afterwards from RemoteFileResult.getRemoteFileName().

Parameters:
localFileName - name (or full path) of the local file to be downloaded to
remoteFileName - name of the remote file to be downloaded (or null to generate a unique name)
callback - callback to be notified when upload is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

uploadFileAsync

public UploadFileResult uploadFileAsync(java.lang.String localFileName,
                                        java.lang.String remoteFileName,
                                        WriteMode writeMode,
                                        AsyncCallback.UploadFile callback,
                                        java.lang.Object tag)
                                 throws FTPException
Upload a file to the FTP server asynchronously. If a null is supplied as the remoteFileName, the STOU (store unique) FTP feature will be used (if available) and the FTP server will generate a unique name for the file. This name can be obtained afterwards from RemoteFileResult.getRemoteFileName().

Parameters:
localFileName - name (or full path) of the local file to be downloaded to
remoteFileName - name of the remote file to be downloaded (or null to generate a unique name)
writeMode - mode in which the file is written to the server
callback - callback to be notified when upload is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

uploadByteArrayAsync

public UploadByteArrayResult uploadByteArrayAsync(byte[] bytes,
                                                  java.lang.String remoteFileName,
                                                  WriteMode writeMode,
                                                  AsyncCallback.UploadByteArray callback,
                                                  java.lang.Object tag)
                                           throws FTPException
Upload a byte array to the FTP server asynchronously. If a null is supplied as the remoteFileName, the STOU (store unique) FTP feature will be used (if available) and the FTP server will generate a unique name for the file. This name can be obtained afterwards from RemoteFileResult.getRemoteFileName().

Parameters:
bytes - byte array to upload
remoteFileName - name of the remote file
writeMode - mode in which the file is written to the server
callback - callback to be notified when upload is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

uploadStreamAsync

public UploadStreamResult uploadStreamAsync(java.lang.String remoteFileName,
                                            AsyncCallback.UploadStream callback,
                                            java.lang.Object tag)
                                     throws FTPException
Upload a file to the FTP server by writing to a stream, asynchronously. If a null is supplied as the remoteFileName, the STOU (store unique) FTP feature will be used (if available) and the FTP server will generate a unique name for the file. This name can be obtained afterwards from RemoteFileResult.getRemoteFileName().

Parameters:
remoteFileName - name of the remote file to be uploaded
callback - callback to be notified when upload is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

uploadStreamAsync

public UploadStreamResult uploadStreamAsync(java.lang.String remoteFileName,
                                            WriteMode writeMode,
                                            AsyncCallback.UploadStream callback,
                                            java.lang.Object tag)
                                     throws FTPException
Upload a file to the FTP server by writing to a stream, asynchronously. If a null is supplied as the remoteFileName, the STOU (store unique) FTP feature will be used (if available) and the FTP server will generate a unique name for the file. This name can be obtained afterwards from RemoteFileResult.getRemoteFileName().

Parameters:
remoteFileName - name of the remote file to be uploaded
writeMode - mode in which the file is written to the server
callback - callback to be notified when upload is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

getSizeAsync

public SizeResult getSizeAsync(java.lang.String remoteFileName,
                               AsyncCallback.Size callback,
                               java.lang.Object tag)
                        throws FTPException
Get the size of a remote file asynchronously.

Parameters:
remoteFileName - name of remote file
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

getModifiedTimeAsync

public ModifiedTimeResult getModifiedTimeAsync(java.lang.String remoteFileName,
                                               AsyncCallback.GetModifiedTime callback,
                                               java.lang.Object tag)
                                        throws FTPException
Get the modified-time of a remote file asynchronously.

Parameters:
remoteFileName - name of remote file
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

setModifiedTimeAsync

public ModifiedTimeResult setModifiedTimeAsync(java.lang.String remoteFileName,
                                               java.util.Date modifiedTime,
                                               AsyncCallback.SetModifiedTime callback,
                                               java.lang.Object tag)
                                        throws FTPException
Set the modified-time of a remote file asynchronously.

Parameters:
remoteFileName - name of remote file
modifiedTime - modified time to set
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

existsAsync

public ExistsResult existsAsync(java.lang.String remoteFileName,
                                AsyncCallback.Exists callback,
                                java.lang.Object tag)
                         throws FTPException
Determine asynchronously if a remote file exists.

Parameters:
remoteFileName - name of remote file
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

deleteFileAsync

public DeleteFileResult deleteFileAsync(java.lang.String remoteFileName,
                                        AsyncCallback.DeleteFile callback,
                                        java.lang.Object tag)
                                 throws FTPException
Deletes a remote file asynchronously.

Parameters:
remoteFileName - name of remote file
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

deleteMultipleFilesAsync

public DeleteMultipleFilesResult deleteMultipleFilesAsync(java.io.FileFilter filter,
                                                          AsyncCallback.DeleteMultipleFiles callback,
                                                          java.lang.Object tag)
                                                   throws FTPException
Deletes remote files in the current directory that match the supplied wildcard

Parameters:
filter - filename filter
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Throws:
FTPException
java.io.IOException

deleteMultipleFilesAsync

public DeleteMultipleFilesResult deleteMultipleFilesAsync(java.lang.String wildcard,
                                                          AsyncCallback.DeleteMultipleFiles callback,
                                                          java.lang.Object tag)
                                                   throws FTPException
Deletes remote files in the current directory that match the supplied wildcard

Parameters:
wildcard - wildcard string (supporting '*' and '?')
Throws:
FTPException
java.io.IOException

deleteMultipleFilesAsync

public DeleteMultipleFilesResult deleteMultipleFilesAsync(java.lang.String remoteDirectory,
                                                          java.lang.String wildcard,
                                                          boolean recursive,
                                                          AsyncCallback.DeleteMultipleFiles callback,
                                                          java.lang.Object tag)
                                                   throws FTPException
Deletes remote files that match the supplied wildcard in the supplied remote directory asynchronously.

Parameters:
remoteDirectory - name of remote directory
wildcard - wildcard string (supporting '*' and '?')
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

deleteMultipleFilesAsync

public DeleteMultipleFilesResult deleteMultipleFilesAsync(java.lang.String remoteDirectory,
                                                          java.io.FileFilter filter,
                                                          boolean recursive,
                                                          AsyncCallback.DeleteMultipleFiles callback,
                                                          java.lang.Object tag)
                                                   throws FTPException
Deletes remote files that match the supplied wildcard in the supplied remote directory asynchronously.

Parameters:
remoteDirectory - name of remote directory
filter - filename filter
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

renameAsync

public RenameResult renameAsync(java.lang.String renameFromName,
                                java.lang.String renameToName,
                                AsyncCallback.Rename callback,
                                java.lang.Object tag)
                         throws FTPException
Rename a remote file asynchronously.

Parameters:
renameFromName - original name
renameToName - new name
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

changeDirectoryAsync

public ChangeDirectoryResult changeDirectoryAsync(java.lang.String directoryName,
                                                  AsyncCallback.ChangeDirectory callback,
                                                  java.lang.Object tag)
                                           throws FTPException
Change directory on the FTP server asynchronously.

Parameters:
directoryName - name the remote directory to change into
callback - callback to be notified when the directory change is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

changeToParentDirectoryAsync

public ChangeDirectoryResult changeToParentDirectoryAsync(AsyncCallback.ChangeDirectory callback,
                                                          java.lang.Object tag)
                                                   throws FTPException
Change directory on the FTP server asynchronously.

Parameters:
callback - callback to be notified when the directory change is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

createDirectoryAsync

public CreateDirectoryResult createDirectoryAsync(java.lang.String directoryName,
                                                  AsyncCallback.CreateDirectory callback,
                                                  java.lang.Object tag)
                                           throws FTPException
Change directory on the FTP server asynchronously.

Parameters:
directoryName - name the remote directory to change into
callback - callback to be notified when the directory change is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

deleteDirectoryAsync

public DeleteDirectoryResult deleteDirectoryAsync(java.lang.String directoryName,
                                                  AsyncCallback.DeleteDirectory callback,
                                                  java.lang.Object tag)
                                           throws FTPException
Delete a directory on the FTP server asynchronously. The directory must be empty, and not the current directory.

Parameters:
directoryName - name the remote directory to delete
callback - callback to be notified when the directory change is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

deleteDirectoryAsync

public DeleteDirectoryResult deleteDirectoryAsync(java.lang.String directoryName,
                                                  boolean recursive,
                                                  AsyncCallback.DeleteDirectory callback,
                                                  java.lang.Object tag)
                                           throws FTPException
Delete a directory on the FTP server asynchronously, and optionally sub-directories. The directory must not be the current directory. The directory must be empty for a non-recursive delete.

Parameters:
directoryName - name the remote directory to delete
recursive -
callback - callback to be notified when the directory delete is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

uploadMultipleAsync

public UploadMultipleResult uploadMultipleAsync(java.lang.String localDir,
                                                java.io.FileFilter filter,
                                                AsyncCallback.UploadMultiple callback,
                                                java.lang.Object tag)
                                         throws FTPException
Uploads local files from the supplied local directory that match the supplied FileFilter into the current remote directory. Not recursive. Operation is asynchronous.

Parameters:
localDir - name of local directory
filter - filename filter
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

uploadMultipleAsync

public UploadMultipleResult uploadMultipleAsync(java.lang.String localDir,
                                                java.lang.String wildcard,
                                                AsyncCallback.UploadMultiple callback,
                                                java.lang.Object tag)
                                         throws FTPException
Uploads local files from the supplied local directory that match the supplied wildcard into the current remote directory. Not recursive. Operation is asynchronous.

Parameters:
localDir - name of local directory
wildcard - wildcard filter for files to be uploaded (supports '*' and '?')
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

uploadMultipleAsync

public UploadMultipleResult uploadMultipleAsync(java.lang.String localDir,
                                                java.lang.String remoteDir,
                                                java.lang.String wildcard,
                                                boolean recursive,
                                                AsyncCallback.UploadMultiple callback,
                                                java.lang.Object tag)
                                         throws FTPException
Uploads local files from the supplied local directory that match the supplied wildcard into the supplied remote directory. If recursive is set to true, goes through all subdirectories. Operation is asynchronous.

Parameters:
localDir - name of local directory
remoteDir - name of remote directory
wildcard - wildcard filter for files to be uploaded (supports '*' and '?')
recursive - if true, operation is recursive through subdirectories
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

uploadMultipleAsync

public UploadMultipleResult uploadMultipleAsync(java.lang.String localDir,
                                                java.lang.String remoteDir,
                                                java.io.FileFilter filter,
                                                boolean recursive,
                                                AsyncCallback.UploadMultiple callback,
                                                java.lang.Object tag)
                                         throws FTPException
Uploads local files from the supplied local directory that match the supplied wildcard into the supplied remote directory. If recursive is set to true, goes through all sub-directories. Operation is asynchronous.

Parameters:
localDir - name of local directory
remoteDir - name of remote directory
filter - filename filter for files to be uploaded
recursive - if true, operation is recursive through sub-directories
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

downloadMultipleAsync

public DownloadMultipleResult downloadMultipleAsync(java.lang.String localDir,
                                                    java.io.FileFilter filter,
                                                    AsyncCallback.DownloadMultiple callback,
                                                    java.lang.Object tag)
                                             throws FTPException
Downloads remote files to the supplied local directory that match the supplied wildcard from the current remote directory. Not recursive. Operation is asynchronous.

Parameters:
localDir - name of local directory
filter - filename filter
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

downloadMultipleAsync

public DownloadMultipleResult downloadMultipleAsync(java.lang.String localDir,
                                                    java.lang.String wildcard,
                                                    AsyncCallback.DownloadMultiple callback,
                                                    java.lang.Object tag)
                                             throws FTPException
Downloads remote files to the supplied local directory that match the supplied wildcard from the current remote directory. Not recursive. Operation is asynchronous.

Parameters:
localDir - name of local directory
wildcard - wildcard filter for files to be uploaded (supports '*' and '?')
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws:
FTPException

downloadMultipleAsync

public DownloadMultipleResult downloadMultipleAsync(java.lang.String localDir,
                                                    java.lang.String remoteDir,
                                                    java.lang.String wildcard,
                                                    boolean recursive,
                                                    AsyncCallback.DownloadMultiple callback,
                                                    java.lang.Object tag)
                                             throws FTPException
Downloads remote files to the supplied local directory that match the supplied wildcard from the current remote directory. If recursive is set to true, goes through all sub-directories. Operation is asynchronous.

Parameters:
localDir - name of local directory
remoteDir - name of remote directory
wildcard - wildcard filter for files to be uploaded (supports '*' and '?')
recursive - if true, operation is recursive through sub-directories
callback - callback to be notified when operation is completed
tag - any object reference can be saved in this tag and can be accessed later from the result object (e.g. in the callback).
Returns:
result object
Throws: