com.enterprisedt.net.ftp.pro
Interface ProFTPClientInterface

All Superinterfaces:
FTPClientInterface
All Known Implementing Classes:
ProFTPClient, SSHFTPClient, SSLFTPClient

public interface ProFTPClientInterface
extends FTPClientInterface

Interface defining additional operations for FTP clients. These include the API equivalents of command line FTP clients' mput and mget.

Some operations permit a wildcard string to be supplied for matching filenames (directories are not matched against the wildcard). The syntax used is '?' for single chars and '*' for multiple chars, e.g. 'asdf??df*abc' would match 'asdfxydfdsfsjfkj33abc'. On Windows clients, case is ignored.

Note that if there are a large number of files to be transferred, the client or server may run out of sockets, as a new socket is created for each data transfer and each directory listing. TCP's TIME_WAIT means that sockets are not reclaimed immediately. If sleeping is enabled via setSleepEnabled(true), then Thread.sleep() is called after n transfers, where n is set by setCountBeforeSleep(n). The time spent asleep is set via setSleepTime().

Version:
$Revision: 1.3 $
Author:
Bruce Blackshaw

Field Summary
static java.lang.String cvsId
          Revision control id
 
Method Summary
 int getCountBeforeSleep()
          Get the number of transfers set before sleeping
 int getSleepTime()
          Get the number of seconds spent asleep
 boolean isSleepEnabled()
          Is sleeping enabled?
 void mdelete(java.io.FileFilter filter)
          Deletes all files matching the filter in the current remote directory only
 void mdelete(java.lang.String wildcard)
          Deletes all files matching the wildcard in the current remote directory only
 void mdelete(java.lang.String remoteDir, java.io.FileFilter filter, boolean recurse)
          Delete all the files in this directory (and its subdirectories if recurse is true) that match the supplied filter.
 void mdelete(java.lang.String remoteDir, java.lang.String wildcard, boolean recurse)
          Delete all the files in this directory (and its subdirectories if recurse is true) that match the supplied wildcard.
 void mget(java.lang.String localDir, java.io.FileFilter filter)
          Get all files matching the filter in the current remote directory only into the supplied local directory
 void mget(java.lang.String localDir, java.lang.String wildcard)
          Get all files matching the filter in the current remote directory only into the supplied local directory
 void mget(java.lang.String localDir, java.lang.String remoteDir, java.io.FileFilter filter, boolean recurse)
          Gets this entire remote directory and its contents, recursively going through the remote directory name supplied.
 void mget(java.lang.String localDir, java.lang.String remoteDir, java.lang.String wildcard, boolean recurse)
          Gets this entire remote directory and its contents, recursively going through the remote directory name supplied.
 void mput(java.lang.String localDir, java.io.FileFilter filter)
          Put all files matching the wildcard in the supplied local directory only into the current remote directory
 void mput(java.lang.String localDir, java.lang.String wildcard)
          Put all files matching the wildcard in the supplied local directory only into the current remote directory
 void mput(java.lang.String localDir, java.lang.String remoteDir, java.io.FileFilter filter, boolean recurse)
          Puts this entire directory and its contents.
 void mput(java.lang.String localDir, java.lang.String remoteDir, java.lang.String wildcard, boolean recurse)
          Puts this entire directory and its contents.
 void rmdir(java.lang.String remoteDir, boolean recurse)
          Delete this remote directory.
 void setCountBeforeSleep(int countBeforeSleep)
          Set the number of transfers required before sleeping
 void setSleepEnabled(boolean sleepEnabled)
          Set sleeping enabled to be on or off
 void setSleepTime(int sleepTime)
          Set the time spent asleep
 
Methods inherited from interface com.enterprisedt.net.ftp.FTPClientInterface
cancelResume, cancelTransfer, cdup, chdir, connect, connected, delete, dir, dir, dir, dirDetails, executeCommand, exists, get, get, get, getDeleteCount, getDetectTransferMode, getDownloadCount, getId, getMonitorInterval, getRemoteHost, getRemotePort, getTimeout, getType, getUploadCount, keepAlive, mkdir, modtime, put, put, put, put, put, put, pwd, quit, quitImmediately, rename, resetDeleteCount, resetDownloadCount, resetUploadCount, resume, rmdir, setControlEncoding, setDetectTransferMode, setId, setModTime, setProgressMonitor, setProgressMonitor, setRemoteHost, setRemotePort, setTimeout, setType, size, system
 

Field Detail

cvsId

static final java.lang.String cvsId
Revision control id

See Also:
Constant Field Values
Method Detail

mdelete

void mdelete(java.lang.String wildcard)
             throws java.io.IOException,
                    FTPException,
                    java.text.ParseException
Deletes all files matching the wildcard in the current remote directory only

Parameters:
wildcard -
Throws:
java.io.IOException
FTPException
java.text.ParseException

mdelete

void mdelete(java.io.FileFilter filter)
             throws java.io.IOException,
                    FTPException,
                    java.text.ParseException
Deletes all files matching the filter in the current remote directory only

Parameters:
filter - file filter
Throws:
java.io.IOException
FTPException
java.text.ParseException

mdelete

void mdelete(java.lang.String remoteDir,
             java.lang.String wildcard,
             boolean recurse)
             throws java.io.IOException,
                    FTPException,
                    java.text.ParseException
Delete all the files in this directory (and its subdirectories if recurse is true) that match the supplied wildcard. No directories are deleted. Only files matching the wildcard are deleted. On Windows clients, case is ignored.

Parameters:
remoteDir - name of remote directory
wildcard - filename wildcard
recurse - if true, recurse through subdirectories
Throws:
java.io.IOException
FTPException
java.text.ParseException

mdelete

void mdelete(java.lang.String remoteDir,
             java.io.FileFilter filter,
             boolean recurse)
             throws java.io.IOException,
                    FTPException,
                    java.text.ParseException
Delete all the files in this directory (and its subdirectories if recurse is true) that match the supplied filter. No directories are deleted. Only files matching the wildcard are deleted. On Windows clients, case is ignored.

Parameters:
remoteDir - name of remote directory
filter - filename filter
recurse - if true, recurse through subdirectories
Throws:
java.io.IOException
FTPException
java.text.ParseException

rmdir

void rmdir(java.lang.String remoteDir,
           boolean recurse)
           throws java.io.IOException,
                  FTPException,
                  java.text.ParseException
Delete this remote directory. If recurse is true, delete all its contents, recursively going through subdirectories. If recurse is false and the directory contains files, an exception will be thrown

Parameters:
remoteDir - name of remote directory
recurse - if true, recurse through subdirectories
Throws:
java.io.IOException
FTPException
java.text.ParseException

mput

void mput(java.lang.String localDir,
          java.lang.String wildcard)
          throws java.io.IOException,
                 FTPException
Put all files matching the wildcard in the supplied local directory only into the current remote directory

Parameters:
localDir - local directory to get files from
wildcard - filename wildcard
Throws:
java.io.IOException
FTPException

mput

void mput(java.lang.String localDir,
          java.io.FileFilter filter)
          throws java.io.IOException,
                 FTPException
Put all files matching the wildcard in the supplied local directory only into the current remote directory

Parameters:
localDir - local directory to get files from
filter - filename filter
Throws:
java.io.IOException
FTPException

mput

void mput(java.lang.String localDir,
          java.lang.String remoteDir,
          java.lang.String wildcard,
          boolean recurse)
          throws FTPException,
                 java.io.IOException
Puts this entire directory and its contents. If recurse is true, recursively go through the local directory supplied (which can be relative or absolute), including subdirectories. Puts the directory into the current remote directory, into a directory with the supplied remoteDir name.

Parameters:
localDir - name of local directory
remoteDir - name of remote directory
wildcard - filename wildcard
recurse - if true recurse into subdirectories
Throws:
java.io.IOException
FTPException

mput

void mput(java.lang.String localDir,
          java.lang.String remoteDir,
          java.io.FileFilter filter,
          boolean recurse)
          throws FTPException,
                 java.io.IOException
Puts this entire directory and its contents. If recurse is true, recursively go through the local directory supplied (which can be relative or absolute), including subdirectories. Puts the directory into the current remote directory, into a directory with the supplied remoteDir name.

Parameters:
localDir - name of local directory
remoteDir - name of remote directory
filter - filename filter
recurse - if true recurse into subdirectories
Throws:
java.io.IOException
FTPException

mget

void mget(java.lang.String localDir,
          java.lang.String wildcard)
          throws FTPException,
                 java.io.IOException,
                 java.text.ParseException
Get all files matching the filter in the current remote directory only into the supplied local directory

Parameters:
localDir - local directory to get files from
wildcard - filename wildcard
Throws:
java.io.IOException
FTPException
java.text.ParseException

mget

void mget(java.lang.String localDir,
          java.io.FileFilter filter)
          throws FTPException,
                 java.io.IOException,
                 java.text.ParseException
Get all files matching the filter in the current remote directory only into the supplied local directory

Parameters:
localDir - local directory to get files from
filter - filename filter
Throws:
java.io.IOException
FTPException
java.text.ParseException

mget

void mget(java.lang.String localDir,
          java.lang.String remoteDir,
          java.lang.String wildcard,
          boolean recurse)
          throws FTPException,
                 java.io.IOException,
                 java.text.ParseException
Gets this entire remote directory and its contents, recursively going through the remote directory name supplied. Gets the directory into the current local directory, into a directory with supplied localDir name

Parameters:
localDir - name of local directory we are transferring into
remoteDir - name of remote directory
wildcard - filename wildcard
recurse - if true recurse into subdirectories
Throws:
java.io.IOException
FTPException
java.text.ParseException

mget

void mget(java.lang.String localDir,
          java.lang.String remoteDir,
          java.io.FileFilter filter,
          boolean recurse)
          throws FTPException,
                 java.io.IOException,
                 java.text.ParseException
Gets this entire remote directory and its contents, recursively going through the remote directory name supplied. Gets the directory into the current local directory, into a directory with supplied localDir name

Parameters:
localDir - name of local directory we are transferring into
remoteDir - name of remote directory
filter - filename filter
recurse - if true recurse into subdirectories
Throws:
java.io.IOException
FTPException
java.text.ParseException

getCountBeforeSleep

int getCountBeforeSleep()
Get the number of transfers set before sleeping

Returns:
integer

setCountBeforeSleep

void setCountBeforeSleep(int countBeforeSleep)
Set the number of transfers required before sleeping

Parameters:
countBeforeSleep - maximum transfer count

isSleepEnabled

boolean isSleepEnabled()
Is sleeping enabled?

Returns:
true if enabled

setSleepEnabled

void setSleepEnabled(boolean sleepEnabled)
Set sleeping enabled to be on or off

Parameters:
sleepEnabled - if true, sleeping is enabled, otherwise it is switched off

getSleepTime

int getSleepTime()
Get the number of seconds spent asleep

Returns:
integer

setSleepTime

void setSleepTime(int sleepTime)
Set the time spent asleep

Parameters:
sleepTime - sleep time in seconds


Copyright © 2001-2006 Enterprise Distributed Technologies Ltd. All Rights Reserved.