|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.enterprisedt.net.ftp.RecursiveOperations
public class RecursiveOperations
Performs various recursive FTP operations. 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().
| Field Summary | |
|---|---|
static java.lang.String |
cvsId
Revision control id |
| Constructor Summary | |
|---|---|
RecursiveOperations()
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String cvsId
| Constructor Detail |
|---|
public RecursiveOperations()
| Method Detail |
|---|
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 seconds
public FTPFile[] dirDetails(FTPClientInterface ftp,
java.lang.String remoteDir)
throws java.io.IOException,
FTPException,
java.text.ParseException
ftp - the FTP client referenceremoteDir - name of remote directory
java.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 directory
java.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 filter
java.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 subdirectories
java.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 subdirectories
java.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 filter
java.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 matching
java.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 filter
java.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 directory
java.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 filter
java.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 matching
java.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 subdirectories
java.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 directory
FTPException
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 directory
FTPException
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 filter
FTPException
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 matching
FTPException
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 filter
FTPException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||