Interface ProFTPClientInterface
- All Superinterfaces:
FTPClientInterface
- All Known Implementing Classes:
ProFTPClient,SSHFTPClient,SSLFTPClient
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$
- Author:
- Bruce Blackshaw
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintGet the number of transfers set before sleepingintGet the maximum bandwidth for transfersGet reference to the extended progress monitorGet the proxy settings instance.intGet the number of seconds spent asleepbooleanIs sleeping enabled?voidmdelete(FileFilter filter) Deletes all files matching the filter in the current remote directory onlyvoidDeletes all files matching the wildcard in the current remote directory onlyvoidmdelete(String remoteDir, FileFilter filter, boolean recurse) Delete all the files in this directory (and its subdirectories if recurse is true) that match the supplied filter.voidDelete all the files in this directory (and its subdirectories if recurse is true) that match the supplied wildcard.voidmget(String localDir, FileFilter filter) Get all files matching the filter in the current remote directory only into the supplied local directoryvoidGet all files matching the filter in the current remote directory only into the supplied local directoryvoidmget(String localDir, String remoteDir, FileFilter filter, boolean recurse) Gets this entire remote directory and its contents, recursively going through the remote directory name supplied.voidGets this entire remote directory and its contents, recursively going through the remote directory name supplied.voidmput(String localDir, FileFilter filter) Put all files matching the wildcard in the supplied local directory only into the current remote directoryvoidPut all files matching the wildcard in the supplied local directory only into the current remote directoryvoidmput(String localDir, String remoteDir, FileFilter filter, boolean recurse) Puts this entire directory and its contents.voidPuts this entire directory and its contents.voidDelete this remote directory.voidsetCountBeforeSleep(int countBeforeSleep) Set the number of transfers required before sleepingvoidsetMaxTransferRate(int thresholdBytesPerSecond) Set the maximum transfer rates in bytes per secvoidsetMonitorInterval(long interval) Set the bytes transferred between each callback on the progress monitorsvoidsetProgressMonitorEx(FTPProgressMonitorEx monitorEx) Set a extended progress monitor for callbacks.voidsetSleepEnabled(boolean sleepEnabled) Set sleeping enabled to be on or offvoidsetSleepTime(int sleepTime) Set the time spent asleepMethods inherited from interface com.enterprisedt.net.ftp.FTPClientInterface
cancelResume, cancelTransfer, cdup, chdir, connect, connected, delete, dir, dir, dir, dirDetails, dirDetails, executeCommand, exists, get, get, get, getDeleteCount, getDetectTransferMode, getDownloadCount, getFileLockingEnabled, getId, getMonitorInterval, getNetworkBufferSize, getRemoteHost, getRemotePort, getTimeout, getType, getUploadCount, keepAlive, mkdir, modtime, put, put, put, put, put, put, pwd, quit, quitImmediately, rename, resetDeleteCount, resetDownloadCount, resetUploadCount, resume, resumeNextDownload, rmdir, setControlEncoding, setDetectTransferMode, setFileLockingEnabled, setId, setModTime, setNetworkBufferSize, setProgressMonitor, setProgressMonitor, setRemoteHost, setRemotePort, setTimeout, setType, size, system
-
Field Details
-
cvsId
Revision control id- See Also:
-
-
Method Details
-
getProgressMonitorEx
FTPProgressMonitorEx getProgressMonitorEx()Get reference to the extended progress monitor- Returns:
- FTPProgressMonitorEx
-
setProgressMonitorEx
Set a extended progress monitor for callbacks.- Parameters:
monitor- the monitor object
-
setMonitorInterval
void setMonitorInterval(long interval) Set the bytes transferred between each callback on the progress monitors -
getProxySettings
ProxySettings getProxySettings()Get the proxy settings instance. Its properties can be set to use proxies.- Returns:
- ProxySettings
-
setMaxTransferRate
void setMaxTransferRate(int thresholdBytesPerSecond) Set the maximum transfer rates in bytes per sec- Parameters:
thresholdBytesPerSecond- maximum bytes per second to transfer
-
getMaxTransferRate
int getMaxTransferRate()Get the maximum bandwidth for transfers- Returns:
- threshold bytes per second, or -1 if no threshold
-
mdelete
Deletes all files matching the wildcard in the current remote directory only- Parameters:
wildcard-- Throws:
IOExceptionFTPExceptionParseException
-
mdelete
Deletes all files matching the filter in the current remote directory only- Parameters:
filter- file filter- Throws:
IOExceptionFTPExceptionParseException
-
mdelete
void mdelete(String remoteDir, String wildcard, boolean recurse) throws IOException, FTPException, 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 directorywildcard- filename wildcardrecurse- if true, recurse through subdirectories- Throws:
IOExceptionFTPExceptionParseException
-
mdelete
void mdelete(String remoteDir, FileFilter filter, boolean recurse) throws IOException, FTPException, 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 directoryfilter- filename filterrecurse- if true, recurse through subdirectories- Throws:
IOExceptionFTPExceptionParseException
-
rmdir
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 directoryrecurse- if true, recurse through subdirectories- Throws:
IOExceptionFTPExceptionParseException
-
mput
Put all files matching the wildcard in the supplied local directory only into the current remote directory- Parameters:
localDir- local directory to get files fromwildcard- filename wildcard- Throws:
IOExceptionFTPException
-
mput
Put all files matching the wildcard in the supplied local directory only into the current remote directory- Parameters:
localDir- local directory to get files fromfilter- filename filter- Throws:
IOExceptionFTPException
-
mput
void mput(String localDir, String remoteDir, String wildcard, boolean recurse) throws FTPException, 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 directoryremoteDir- name of remote directorywildcard- filename wildcardrecurse- if true recurse into subdirectories- Throws:
IOExceptionFTPException
-
mput
void mput(String localDir, String remoteDir, FileFilter filter, boolean recurse) throws FTPException, 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 directoryremoteDir- name of remote directoryfilter- filename filterrecurse- if true recurse into subdirectories- Throws:
IOExceptionFTPException
-
mget
Get all files matching the filter in the current remote directory only into the supplied local directory- Parameters:
localDir- local directory to get files fromwildcard- filename wildcard- Throws:
IOExceptionFTPExceptionParseException
-
mget
Get all files matching the filter in the current remote directory only into the supplied local directory- Parameters:
localDir- local directory to get files fromfilter- filename filter- Throws:
IOExceptionFTPExceptionParseException
-
mget
void mget(String localDir, String remoteDir, String wildcard, boolean recurse) throws FTPException, IOException, 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 intoremoteDir- name of remote directorywildcard- filename wildcardrecurse- if true recurse into subdirectories- Throws:
IOExceptionFTPExceptionParseException
-
mget
void mget(String localDir, String remoteDir, FileFilter filter, boolean recurse) throws FTPException, IOException, 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 intoremoteDir- name of remote directoryfilter- filename filterrecurse- if true recurse into subdirectories- Throws:
IOExceptionFTPExceptionParseException
-
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
-