|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.enterprisedt.net.ftp.FTPClient
com.enterprisedt.net.ftp.pro.ProFTPClient
public class ProFTPClient
Subclass of FTPClient that adds numerous useful methods, mainly for getting and putting of multiple files, including recursively going through directories. Also supports IPV6.
| Field Summary | |
|---|---|
static java.lang.String |
cvsId
Revision control id |
protected ProxySettings |
proxySettings
The proxy settings |
| Constructor Summary | |
|---|---|
ProFTPClient()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
connect()
Connects to the server at the address and port number defined in the constructor. |
void |
enableModeZCompression()
Set MODE Z so that all subsequent transfers are compressed |
int |
getCountBeforeSleep()
Get the number of transfers set before sleeping |
protected java.io.InputStream |
getInputStream()
Get the data input stream. |
int |
getLocalCRC(byte[] bytes)
Get the CRC-32 checksum for the supplied byte array |
int |
getLocalCRC(java.lang.String path)
Get the CRC-32 checksum for the named local file. |
int |
getMaxTransferRate()
Get the maximum bandwidth for transfers |
protected java.io.OutputStream |
getOutputStream()
Get the data input stream. |
ProxySettings |
getProxySettings()
Get the proxy settings instance. |
java.lang.String |
getRemoteCRC(java.lang.String path)
Get the CRC-32 checksum for the named remote file. |
int |
getSleepTime()
Get the number of seconds spent asleep |
protected void |
integrityCheckTransferCRC(byte[] localBytes,
java.lang.String remoteFile)
|
protected void |
integrityCheckTransferCRC(java.lang.String localPath,
java.lang.String remoteFile)
|
protected void |
integrityCheckTransferSize(long length,
java.lang.String remoteFile)
|
boolean |
isModeZCompressionEnabled()
Are we in mode z currently? |
boolean |
isSleepEnabled()
Is sleeping enabled? |
boolean |
isTransferIntegrityCheck()
Is integrity checking of transfers 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. |
protected void |
postTransferChecks(byte[] localBytes,
java.lang.String remotePath,
FTPTransferType type,
boolean append)
Can be overridden by subclasses to do any necessary post transfer checking. |
protected void |
postTransferChecks(java.lang.String localPath,
java.lang.String remotePath,
FTPTransferType type,
boolean append)
Can be overridden by subclasses to do any necessary post transfer checking. |
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 |
setMaxTransferRate(int thresholdBytesPerSecond)
Set the maximum transfer rates in bytes per sec |
void |
setSleepEnabled(boolean sleepEnabled)
Set sleeping enabled to be on or off |
void |
setSleepTime(int sleepTime)
Set the time spent asleep |
void |
setTransferIntegrityCheck(boolean enable)
Enable or disable integrity checking of transfers. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.enterprisedt.net.ftp.pro.ProFTPClientInterface |
|---|
getProgressMonitorEx, setMonitorInterval, setProgressMonitorEx |
| Methods inherited from interface com.enterprisedt.net.ftp.FTPClientInterface |
|---|
cancelResume, cancelTransfer, cdup, chdir, connected, delete, dir, dir, dir, dirDetails, 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 |
|---|
public static final java.lang.String cvsId
protected ProxySettings proxySettings
| Constructor Detail |
|---|
public ProFTPClient()
FTPClient.connect() method is used to
perform the actual connection to the remote host.
| Method Detail |
|---|
public ProxySettings getProxySettings()
getProxySettings in interface ProFTPClientInterface
public void connect()
throws java.io.IOException,
FTPException
connect in interface FTPClientInterfaceconnect in class FTPClientjava.io.IOException - Thrown if there is a TCP/IP-related error.
FTPException - Thrown if there is an error related to the FTP protocol.
public void enableModeZCompression()
throws java.io.IOException,
FTPException
java.io.IOException
FTPException
public int getLocalCRC(java.lang.String path)
throws java.io.IOException
path - local file path
FTPException
java.io.IOException
public int getLocalCRC(byte[] bytes)
throws java.io.IOException
bytes - byte array
FTPException
java.io.IOExceptionpublic void setTransferIntegrityCheck(boolean enable)
enable - true to enable, false to disablepublic boolean isTransferIntegrityCheck()
public java.lang.String getRemoteCRC(java.lang.String path)
throws FTPException,
java.io.IOException
path - file path on server
FTPException
java.io.IOException
protected void postTransferChecks(java.lang.String localPath,
java.lang.String remotePath,
FTPTransferType type,
boolean append)
throws FTPException,
java.io.IOException
postTransferChecks in class FTPClientlocalPath - local fileremotePath - remote filetype - binary or ASCIIappend -
java.io.IOException
FTPException
protected void integrityCheckTransferCRC(java.lang.String localPath,
java.lang.String remoteFile)
throws java.io.IOException,
FTPException
java.io.IOException
FTPException
protected void integrityCheckTransferCRC(byte[] localBytes,
java.lang.String remoteFile)
throws java.io.IOException,
FTPException
java.io.IOException
FTPException
protected void integrityCheckTransferSize(long length,
java.lang.String remoteFile)
throws java.io.IOException,
FTPException
java.io.IOException
FTPException
protected void postTransferChecks(byte[] localBytes,
java.lang.String remotePath,
FTPTransferType type,
boolean append)
throws FTPException,
java.io.IOException
postTransferChecks in class FTPClientlocalBytes - local bytes to transferremotePath - remote filetransferType - binary or ASCIIappend -
FTPException
java.io.IOException
protected java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class FTPClientjava.io.IOException
protected java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in class FTPClientjava.io.IOExceptionpublic boolean isModeZCompressionEnabled()
public void setMaxTransferRate(int thresholdBytesPerSecond)
setMaxTransferRate in interface ProFTPClientInterfacethresholdBytesPerSecond - maximum bytes per second to transferpublic int getMaxTransferRate()
getMaxTransferRate in interface ProFTPClientInterface
public void mdelete(java.lang.String wildcard)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
mdelete in interface ProFTPClientInterfacejava.io.IOException
FTPException
java.text.ParseException
public void mdelete(java.io.FileFilter filter)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
mdelete in interface ProFTPClientInterfacefilter - file filter
java.io.IOException
FTPException
java.text.ParseException
public void mdelete(java.lang.String remoteDir,
java.lang.String wildcard,
boolean recurse)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
mdelete in interface ProFTPClientInterfaceremoteDir - name of remote directorywildcard - filename wildcardrecurse - if true, recurse through subdirectories
java.io.IOException
FTPException
java.text.ParseException
public void mdelete(java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
mdelete in interface ProFTPClientInterfaceremoteDir - name of remote directoryfilter - filename filterrecurse - if true, recurse through subdirectories
java.io.IOException
FTPException
java.text.ParseException
public void rmdir(java.lang.String remoteDir,
boolean recurse)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
rmdir in interface ProFTPClientInterfaceremoteDir - name of remote directoryrecurse - if true, recurse through subdirectories
java.io.IOException
FTPException
java.text.ParseException
public void mput(java.lang.String localDir,
java.lang.String wildcard)
throws java.io.IOException,
FTPException
ProFTPClientInterface
mput in interface ProFTPClientInterfacelocalDir - local directory to get files fromwildcard - filename wildcard
java.io.IOException
FTPException
public void mput(java.lang.String localDir,
java.io.FileFilter filter)
throws java.io.IOException,
FTPException
ProFTPClientInterface
mput in interface ProFTPClientInterfacelocalDir - local directory to get files fromfilter - filename filter
java.io.IOException
FTPException
public void mput(java.lang.String localDir,
java.lang.String remoteDir,
java.lang.String wildcard,
boolean recurse)
throws FTPException,
java.io.IOException
ProFTPClientInterface
mput in interface ProFTPClientInterfacelocalDir - name of local directoryremoteDir - name of remote directorywildcard - filename wildcardrecurse - if true recurse into subdirectories
FTPException
java.io.IOException
public void mput(java.lang.String localDir,
java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
throws FTPException,
java.io.IOException
ProFTPClientInterface
mput in interface ProFTPClientInterfacelocalDir - name of local directoryremoteDir - name of remote directoryfilter - filename filterrecurse - if true recurse into subdirectories
FTPException
java.io.IOException
public void mget(java.lang.String localDir,
java.lang.String wildcard)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
mget in interface ProFTPClientInterfacelocalDir - local directory to get files fromwildcard - filename wildcard
java.io.IOException
FTPException
java.text.ParseException
public void mget(java.lang.String localDir,
java.io.FileFilter filter)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
mget in interface ProFTPClientInterfacelocalDir - local directory to get files fromfilter - filename filter
java.io.IOException
FTPException
java.text.ParseException
public void mget(java.lang.String localDir,
java.lang.String remoteDir,
java.lang.String wildcard,
boolean recurse)
throws FTPException,
java.io.IOException,
java.text.ParseException
ProFTPClientInterface
mget in interface ProFTPClientInterfacelocalDir - name of local directory we are transferring intoremoteDir - name of remote directorywildcard - filename wildcardrecurse - if true recurse into subdirectories
FTPException
java.io.IOException
java.text.ParseException
public void mget(java.lang.String localDir,
java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
throws FTPException,
java.io.IOException,
java.text.ParseException
ProFTPClientInterface
mget in interface ProFTPClientInterfacelocalDir - name of local directory we are transferring intoremoteDir - name of remote directoryfilter - filename filterrecurse - if true recurse into subdirectories
FTPException
java.io.IOException
java.text.ParseExceptionpublic int getCountBeforeSleep()
ProFTPClientInterface
getCountBeforeSleep in interface ProFTPClientInterfacepublic void setCountBeforeSleep(int countBeforeSleep)
ProFTPClientInterface
setCountBeforeSleep in interface ProFTPClientInterfacecountBeforeSleep - maximum transfer countpublic boolean isSleepEnabled()
ProFTPClientInterface
isSleepEnabled in interface ProFTPClientInterfacepublic void setSleepEnabled(boolean sleepEnabled)
ProFTPClientInterface
setSleepEnabled in interface ProFTPClientInterfacesleepEnabled - if true, sleeping is enabled, otherwise it is switched offpublic int getSleepTime()
ProFTPClientInterface
getSleepTime in interface ProFTPClientInterfacepublic void setSleepTime(int sleepTime)
ProFTPClientInterface
setSleepTime in interface ProFTPClientInterfacesleepTime - sleep time in seconds
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||