public class ProFTPClient extends FTPClient implements ProFTPClientInterface
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
cvsId
Revision control id
|
protected ProxySettings |
proxySettings
The proxy settings
|
CARRIAGE_RETURN, control, controlEncoding, controlPort, data, dataChannelCallback, dataReceiveBufferSize, dataSendBufferSize, DEFAULT_BUFFER_SIZE, DEFAULT_ENCODING, DEFAULT_LISTING_LOCALES, DEFAULT_MONITOR_INTERVAL, DEFAULT_RETRY_COUNT, DEFAULT_RETRY_DELAY, DEFAULT_TCP_BUFFER_SIZE, DEFAULT_TIMEOUT, detectTransferMode, dirEmptyStrings, fileLockingEnabled, fileNotFoundStrings, FTP_LINE_SEPARATOR, id, lastReply, lastValidReply, LINE_FEED, LINE_SEPARATOR, messageListener, monitor, monitorEx, monitorInterval, password, remoteAddr, remoteHost, serverWakeupInterval, throttler, timeout, transferBufferSize, transferCompleteStrings, transferType, useNOOP, user| Constructor and Description |
|---|
ProFTPClient()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
abort, account, cancelResume, cancelTransfer, cdup, chdir, checkConnection, chooseTransferMode, clearSOCKS, closeDataSocket, closeDataSocket, configureDataSocket, connected, createDataSocket, debugResponses, delete, dir, dir, dir, dirDetails, dirDetails, dirDetailsM, executeCommand, exists, existsDirectory, existsFile, features, fileDetails, forceResumeOff, get, get, get, getActiveHighPort, getActiveIPAddress, getActiveLowPort, getBuildTimestamp, getConnectMode, getControlEncoding, getControlPort, getDataReceiveBufferSize, getDataSendBufferSize, getDeleteCount, getDetectTransferMode, getDirectoryEmptyMessages, getDownloadCount, getFileLockingEnabled, getFileNotFoundMessages, getId, getLastReply, getLastValidReply, getListenOnAllInterfaces, getMessageListener, getMonitorInterval, getNetworkBufferSize, getProgressMonitor, getProgressMonitorEx, getRemoteAddr, getRemoteHost, getRemotePort, getRetryCount, getRetryDelay, getServerWakeupInterval, getTimeout, getTransferBufferSize, getTransferCompleteMessages, getType, getUploadCount, getVersion, help, initGet, initialize, initPut, initSOCKS, initSOCKSAuthentication, isAutoPassiveIPSubstitution, isDeleteOnFailure, isStrictReturnCodes, isTransferCancelled, keepAlive, list, list, login, login, mkdir, modtime, noOp, noOperation, password, put, put, put, put, put, put, pwd, quit, quitImmediately, quote, quote, readChar, readChunk, readChunk, readLine, reconnect, rename, resetDeleteCount, resetDownloadCount, resetTransferMode, resetUploadCount, restart, resume, resumeNextDownload, rmdir, sendCommand, sendServerWakeup, setActiveIPAddress, setActivePortRange, setAutoPassiveIPSubstitution, setConnectMode, setControlEncoding, setControlPort, setDataChannelCallback, setDataReceiveBufferSize, setDataSendBufferSize, setDeleteOnFailure, setDetectTransferMode, setDirectoryEmptyMessages, setFileLockingEnabled, setFileNotFoundMessages, setForceUniqueNames, setFTPFileFactory, setId, setListenOnAllInterfaces, setMessageListener, setModTime, setMonitorInterval, setNetworkBufferSize, setParserLocale, setParserLocales, setPORTIP, setProgressMonitor, setProgressMonitor, setProgressMonitorEx, setRemoteAddr, setRemoteHost, setRemotePort, setRetryCount, setRetryDelay, setServerWakeupInterval, setStrictReturnCodes, setTimeout, setTransferBufferSize, setTransferCompleteMessages, setType, site, size, stat, system, toString, user, validateReply, validateReply, validateTransfer, validateTransferOnErrorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetProgressMonitorEx, setMonitorInterval, setProgressMonitorExcancelResume, cancelTransfer, cdup, chdir, 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, systempublic static final java.lang.String cvsId
protected ProxySettings proxySettings
public ProFTPClient()
FTPClient.connect() method is used to
perform the actual connection to the remote host.public ProxySettings getProxySettings()
getProxySettings in interface ProFTPClientInterfacepublic 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.IOExceptionFTPExceptionpublic int getLocalCRC(java.lang.String path)
throws java.io.IOException
path - local file pathFTPExceptionjava.io.IOExceptionpublic int getLocalCRC(byte[] bytes)
throws java.io.IOException
bytes - byte arrayFTPExceptionjava.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 serverFTPExceptionjava.io.IOExceptionprotected 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.IOExceptionFTPExceptionprotected void integrityCheckTransferCRC(java.lang.String localPath,
java.lang.String remoteFile)
throws java.io.IOException,
FTPException
java.io.IOExceptionFTPExceptionprotected void integrityCheckTransferCRC(byte[] localBytes,
java.lang.String remoteFile)
throws java.io.IOException,
FTPException
java.io.IOExceptionFTPExceptionprotected void integrityCheckTransferSize(long length,
java.lang.String remoteFile)
throws java.io.IOException,
FTPException
java.io.IOExceptionFTPExceptionprotected 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 - FTPExceptionjava.io.IOExceptionprotected java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class FTPClientjava.io.IOExceptionprotected 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 ProFTPClientInterfacepublic void mdelete(java.lang.String wildcard)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterfacemdelete in interface ProFTPClientInterfacejava.io.IOExceptionFTPExceptionjava.text.ParseExceptionpublic void mdelete(java.io.FileFilter filter)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterfacemdelete in interface ProFTPClientInterfacefilter - file filterjava.io.IOExceptionFTPExceptionjava.text.ParseExceptionpublic void mdelete(java.lang.String remoteDir,
java.lang.String wildcard,
boolean recurse)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterfacemdelete in interface ProFTPClientInterfaceremoteDir - name of remote directorywildcard - filename wildcardrecurse - if true, recurse through subdirectoriesjava.io.IOExceptionFTPExceptionjava.text.ParseExceptionpublic void mdelete(java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterfacemdelete in interface ProFTPClientInterfaceremoteDir - name of remote directoryfilter - filename filterrecurse - if true, recurse through subdirectoriesjava.io.IOExceptionFTPExceptionjava.text.ParseExceptionpublic void rmdir(java.lang.String remoteDir,
boolean recurse)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterfacermdir in interface ProFTPClientInterfaceremoteDir - name of remote directoryrecurse - if true, recurse through subdirectoriesjava.io.IOExceptionFTPExceptionjava.text.ParseExceptionpublic void mput(java.lang.String localDir,
java.lang.String wildcard)
throws java.io.IOException,
FTPException
ProFTPClientInterfacemput in interface ProFTPClientInterfacelocalDir - local directory to get files fromwildcard - filename wildcardjava.io.IOExceptionFTPExceptionpublic void mput(java.lang.String localDir,
java.io.FileFilter filter)
throws java.io.IOException,
FTPException
ProFTPClientInterfacemput in interface ProFTPClientInterfacelocalDir - local directory to get files fromfilter - filename filterjava.io.IOExceptionFTPExceptionpublic void mput(java.lang.String localDir,
java.lang.String remoteDir,
java.lang.String wildcard,
boolean recurse)
throws FTPException,
java.io.IOException
ProFTPClientInterfacemput in interface ProFTPClientInterfacelocalDir - name of local directoryremoteDir - name of remote directorywildcard - filename wildcardrecurse - if true recurse into subdirectoriesFTPExceptionjava.io.IOExceptionpublic void mput(java.lang.String localDir,
java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
throws FTPException,
java.io.IOException
ProFTPClientInterfacemput in interface ProFTPClientInterfacelocalDir - name of local directoryremoteDir - name of remote directoryfilter - filename filterrecurse - if true recurse into subdirectoriesFTPExceptionjava.io.IOExceptionpublic void mget(java.lang.String localDir,
java.lang.String wildcard)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterfacemget in interface ProFTPClientInterfacelocalDir - local directory to get files fromwildcard - filename wildcardjava.io.IOExceptionFTPExceptionjava.text.ParseExceptionpublic void mget(java.lang.String localDir,
java.io.FileFilter filter)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterfacemget in interface ProFTPClientInterfacelocalDir - local directory to get files fromfilter - filename filterjava.io.IOExceptionFTPExceptionjava.text.ParseExceptionpublic void mget(java.lang.String localDir,
java.lang.String remoteDir,
java.lang.String wildcard,
boolean recurse)
throws FTPException,
java.io.IOException,
java.text.ParseException
ProFTPClientInterfacemget in interface ProFTPClientInterfacelocalDir - name of local directory we are transferring intoremoteDir - name of remote directorywildcard - filename wildcardrecurse - if true recurse into subdirectoriesFTPExceptionjava.io.IOExceptionjava.text.ParseExceptionpublic void mget(java.lang.String localDir,
java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
throws FTPException,
java.io.IOException,
java.text.ParseException
ProFTPClientInterfacemget in interface ProFTPClientInterfacelocalDir - name of local directory we are transferring intoremoteDir - name of remote directoryfilter - filename filterrecurse - if true recurse into subdirectoriesFTPExceptionjava.io.IOExceptionjava.text.ParseExceptionpublic int getCountBeforeSleep()
ProFTPClientInterfacegetCountBeforeSleep in interface ProFTPClientInterfacepublic void setCountBeforeSleep(int countBeforeSleep)
ProFTPClientInterfacesetCountBeforeSleep in interface ProFTPClientInterfacecountBeforeSleep - maximum transfer countpublic boolean isSleepEnabled()
ProFTPClientInterfaceisSleepEnabled in interface ProFTPClientInterfacepublic void setSleepEnabled(boolean sleepEnabled)
ProFTPClientInterfacesetSleepEnabled in interface ProFTPClientInterfacesleepEnabled - if true, sleeping is enabled, otherwise it is switched offpublic int getSleepTime()
ProFTPClientInterfacegetSleepTime in interface ProFTPClientInterfacepublic void setSleepTime(int sleepTime)
ProFTPClientInterfacesetSleepTime in interface ProFTPClientInterfacesleepTime - sleep time in secondsCopyright © 2001-2014 Enterprise Distributed Technologies Ltd. All Rights Reserved.