public class RecursiveOperations
extends java.lang.Object
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().
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
cvsId
Revision control id
|
Constructor and Description |
---|
RecursiveOperations() |
Modifier and Type | Method and Description |
---|---|
void |
delete(FTPClientInterface ftp,
java.lang.String remoteDir)
Delete this entire remote directory and its contents, recursively going
through the remote directory name supplied
|
void |
deleteFiles(FTPClientInterface ftp,
java.io.FileFilter filter,
boolean recurse)
Delete all the files in the current directory (and its subdirectories if indicated) that
match the supplied filter, recursively going through the remote
directories.
|
void |
deleteFiles(FTPClientInterface ftp,
java.lang.String remoteDir,
java.io.FileFilter filter)
Delete all the files in this directory (and its subdirectories) that
match the supplied filter, recursively going through the remote
directories.
|
void |
deleteFiles(FTPClientInterface ftp,
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, recursively going through the
remote directories.
|
void |
deleteFiles(FTPClientInterface ftp,
java.lang.String remoteDir,
java.lang.String wildcard)
Delete all the files in this directory (and its subdirectories) that
match the supplied wildcard, recursively going through the remote
directories.
|
void |
deleteFilesCurrentDir(FTPClientInterface ftp,
java.io.FileFilter filter)
Delete all the files in this directory (not subdirectories) that match
the supplied filter.
|
FTPFile[] |
dirDetails(FTPClientInterface ftp,
java.lang.String remoteDir)
List this entire remote directory and its contents, including children.
|
void |
get(FTPClientInterface ftp,
java.lang.String localDir,
java.lang.String remoteDir)
Gets this entire remote directory and its contents, recursively going
through the remote directory name supplied.
|
void |
get(FTPClientInterface ftp,
java.lang.String localDir,
java.lang.String remoteDir,
java.io.FileFilter filter)
Gets this entire remote directory and its contents, recursively going
through the remote directory name supplied.
|
void |
get(FTPClientInterface ftp,
java.lang.String localDir,
java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
Gets this entire remote directory and its contents, recursively (if
recurse is true) going through the remote directory name supplied.
|
void |
get(FTPClientInterface ftp,
java.lang.String localDir,
java.lang.String remoteDir,
java.lang.String wildcard)
Gets this entire remote directory and its contents, recursively going
through the remote directory name supplied.
|
int |
getCountBeforeSleep()
Get the number of transfers set before sleeping
|
void |
getFilesFromCurrentDir(FTPClientInterface ftp,
java.lang.String localDir,
java.io.FileFilter filter)
Gets all files matching the supplied filter from current remote directory
into supplied local dir.
|
int |
getSleepTime()
Get the number of seconds spent asleep
|
boolean |
isSleepEnabled()
Is sleeping enabled?
|
void |
put(FTPClientInterface ftp,
java.lang.String localDir,
java.lang.String remoteDir)
Puts this entire directory and its contents, recursively going through
the local directory supplied (which can be relative or absolute.
|
void |
put(FTPClientInterface ftp,
java.lang.String localDir,
java.lang.String remoteDir,
java.io.FileFilter filter)
Puts this entire directory and its contents, recursively going through
the local directory supplied (which can be relative or absolute.
|
void |
put(FTPClientInterface ftp,
java.lang.String localDir,
java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
Puts this entire directory and its contents.
|
void |
put(FTPClientInterface ftp,
java.lang.String localDir,
java.lang.String remoteDir,
java.lang.String wildcard)
Puts this entire directory and its contents, recursively going through
the local directory supplied (which can be relative or absolute.
|
void |
putFilesIntoCurrentDir(FTPClientInterface ftp,
java.lang.String localDir,
java.io.FileFilter filter)
Puts all files from supplied local dir matching the supplied filter into
the current 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
|
public int getCountBeforeSleep()
public void setCountBeforeSleep(int countBeforeSleep)
countBeforeSleep
- maximum transfer countpublic boolean isSleepEnabled()
public void setSleepEnabled(boolean sleepEnabled)
sleepEnabled
- if true, sleeping is enabled, otherwise it is switched offpublic int getSleepTime()
public void setSleepTime(int sleepTime)
sleepTime
- sleep time in secondspublic FTPFile[] dirDetails(FTPClientInterface ftp, java.lang.String remoteDir) throws java.io.IOException, FTPException, java.text.ParseException
ftp
- the FTP client referenceremoteDir
- name of remote directoryjava.io.IOException
FTPException
java.text.ParseException
public void delete(FTPClientInterface ftp, java.lang.String remoteDir) throws java.io.IOException, FTPException, java.text.ParseException
ftp
- the FTP client referenceremoteDir
- name of remote directoryjava.io.IOException
FTPException
java.text.ParseException
public void deleteFilesCurrentDir(FTPClientInterface ftp, java.io.FileFilter filter) throws java.io.IOException, FTPException, java.text.ParseException
ftp
- the FTP client referencefilter
- filename filterjava.io.IOException
FTPException
java.text.ParseException
public void deleteFiles(FTPClientInterface ftp, java.lang.String remoteDir, java.io.FileFilter filter, boolean recurse) throws java.io.IOException, FTPException, java.text.ParseException
ftp
- the FTP client referenceremoteDir
- name of remote directoryfilter
- filename filterrecurse
- true if recursing through subdirectoriesjava.io.IOException
FTPException
java.text.ParseException
public void deleteFiles(FTPClientInterface ftp, java.io.FileFilter filter, boolean recurse) throws java.io.IOException, FTPException, java.text.ParseException
ftp
- the FTP client referencefilter
- filename filterrecurse
- true if recursing through subdirectoriesjava.io.IOException
FTPException
java.text.ParseException
public void deleteFiles(FTPClientInterface ftp, java.lang.String remoteDir, java.io.FileFilter filter) throws java.io.IOException, FTPException, java.text.ParseException
ftp
- the FTP client referenceremoteDir
- name of remote directoryfilter
- filename filterjava.io.IOException
FTPException
java.text.ParseException
public void deleteFiles(FTPClientInterface ftp, java.lang.String remoteDir, java.lang.String wildcard) throws java.io.IOException, FTPException, java.text.ParseException
ftp
- the FTP client referenceremoteDir
- name of remote directorywildcard
- wildcard for filename matchingjava.io.IOException
FTPException
java.text.ParseException
public void getFilesFromCurrentDir(FTPClientInterface ftp, java.lang.String localDir, java.io.FileFilter filter) throws java.io.IOException, FTPException, java.text.ParseException
ftp
- the FTP client referencelocalDir
- name of local directory to get files intofilter
- filename filterjava.io.IOException
FTPException
java.text.ParseException
public void get(FTPClientInterface ftp, java.lang.String localDir, java.lang.String remoteDir) throws java.io.IOException, FTPException, java.text.ParseException
ftp
- the FTP client referencelocalDir
- name of local directory we are transferring intoremoteDir
- name of remote directoryjava.io.IOException
FTPException
java.text.ParseException
public void get(FTPClientInterface ftp, java.lang.String localDir, java.lang.String remoteDir, java.io.FileFilter filter) throws java.io.IOException, FTPException, java.text.ParseException
ftp
- the FTP client referencelocalDir
- name of local directory we are transferring intoremoteDir
- name of remote directoryfilter
- filename filterjava.io.IOException
FTPException
java.text.ParseException
public void get(FTPClientInterface ftp, java.lang.String localDir, java.lang.String remoteDir, java.lang.String wildcard) throws java.io.IOException, FTPException, java.text.ParseException
ftp
- the FTP client referencelocalDir
- name of local directory we are transferring intoremoteDir
- name of remote directorywildcard
- wildcard for filename matchingjava.io.IOException
FTPException
java.text.ParseException
public void get(FTPClientInterface ftp, java.lang.String localDir, java.lang.String remoteDir, java.io.FileFilter filter, boolean recurse) throws java.io.IOException, FTPException, java.text.ParseException
ftp
- the FTP client referencelocalDir
- name of local directory we are transferring intoremoteDir
- name of remote directoryfilter
- filename filterrecurse
- if true recurse through subdirectoriesjava.io.IOException
FTPException
java.text.ParseException
public void putFilesIntoCurrentDir(FTPClientInterface ftp, java.lang.String localDir, java.io.FileFilter filter) throws FTPException, java.io.IOException
ftp
- the FTP client referencelocalDir
- name of local directoryFTPException
java.io.IOException
public void put(FTPClientInterface ftp, java.lang.String localDir, java.lang.String remoteDir) throws FTPException, java.io.IOException
ftp
- the FTP client referencelocalDir
- name of local directoryremoteDir
- name of remote directoryFTPException
java.io.IOException
public void put(FTPClientInterface ftp, java.lang.String localDir, java.lang.String remoteDir, java.io.FileFilter filter) throws FTPException, java.io.IOException
ftp
- the FTP client referencelocalDir
- name of local directoryremoteDir
- name of remote directoryfilter
- filename filterFTPException
java.io.IOException
public void put(FTPClientInterface ftp, java.lang.String localDir, java.lang.String remoteDir, java.lang.String wildcard) throws FTPException, java.io.IOException
ftp
- the FTP client referencelocalDir
- name of local directoryremoteDir
- name of remote directorywildcard
- wildcard for filename matchingFTPException
java.io.IOException
public void put(FTPClientInterface ftp, java.lang.String localDir, java.lang.String remoteDir, java.io.FileFilter filter, boolean recurse) throws FTPException, java.io.IOException
ftp
- the FTP client referencelocalDir
- name of local directoryremoteDir
- name of remote directory, or null if the current remote directoryfilter
- filename filterFTPException
java.io.IOException
Copyright © 2001-2014 Enterprise Distributed Technologies Ltd. All Rights Reserved.