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, validateTransferOnError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getProgressMonitorEx, setMonitorInterval, setProgressMonitorEx
cancelResume, 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, system
public 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 ProFTPClientInterface
public void connect() throws java.io.IOException, FTPException
connect
in interface FTPClientInterface
connect
in class FTPClient
java.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 pathFTPException
java.io.IOException
public int getLocalCRC(byte[] bytes) throws java.io.IOException
bytes
- byte arrayFTPException
java.io.IOException
public 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 serverFTPException
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 FTPClient
localPath
- 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 FTPClient
localBytes
- 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 FTPClient
java.io.IOException
protected java.io.OutputStream getOutputStream() throws java.io.IOException
getOutputStream
in class FTPClient
java.io.IOException
public boolean isModeZCompressionEnabled()
public void setMaxTransferRate(int thresholdBytesPerSecond)
setMaxTransferRate
in interface ProFTPClientInterface
thresholdBytesPerSecond
- 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 ProFTPClientInterface
java.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 ProFTPClientInterface
filter
- file filterjava.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 ProFTPClientInterface
remoteDir
- name of remote directorywildcard
- filename wildcardrecurse
- if true, recurse through subdirectoriesjava.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 ProFTPClientInterface
remoteDir
- name of remote directoryfilter
- filename filterrecurse
- if true, recurse through subdirectoriesjava.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 ProFTPClientInterface
remoteDir
- name of remote directoryrecurse
- if true, recurse through subdirectoriesjava.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 ProFTPClientInterface
localDir
- local directory to get files fromwildcard
- filename wildcardjava.io.IOException
FTPException
public void mput(java.lang.String localDir, java.io.FileFilter filter) throws java.io.IOException, FTPException
ProFTPClientInterface
mput
in interface ProFTPClientInterface
localDir
- local directory to get files fromfilter
- filename filterjava.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 ProFTPClientInterface
localDir
- name of local directoryremoteDir
- name of remote directorywildcard
- filename wildcardrecurse
- if true recurse into subdirectoriesFTPException
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 ProFTPClientInterface
localDir
- name of local directoryremoteDir
- name of remote directoryfilter
- filename filterrecurse
- if true recurse into subdirectoriesFTPException
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 ProFTPClientInterface
localDir
- local directory to get files fromwildcard
- filename wildcardjava.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 ProFTPClientInterface
localDir
- local directory to get files fromfilter
- filename filterjava.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 ProFTPClientInterface
localDir
- name of local directory we are transferring intoremoteDir
- name of remote directorywildcard
- filename wildcardrecurse
- if true recurse into subdirectoriesFTPException
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 ProFTPClientInterface
localDir
- name of local directory we are transferring intoremoteDir
- name of remote directoryfilter
- filename filterrecurse
- if true recurse into subdirectoriesFTPException
java.io.IOException
java.text.ParseException
public int getCountBeforeSleep()
ProFTPClientInterface
getCountBeforeSleep
in interface ProFTPClientInterface
public void setCountBeforeSleep(int countBeforeSleep)
ProFTPClientInterface
setCountBeforeSleep
in interface ProFTPClientInterface
countBeforeSleep
- maximum transfer countpublic boolean isSleepEnabled()
ProFTPClientInterface
isSleepEnabled
in interface ProFTPClientInterface
public void setSleepEnabled(boolean sleepEnabled)
ProFTPClientInterface
setSleepEnabled
in interface ProFTPClientInterface
sleepEnabled
- if true, sleeping is enabled, otherwise it is switched offpublic int getSleepTime()
ProFTPClientInterface
getSleepTime
in interface ProFTPClientInterface
public void setSleepTime(int sleepTime)
ProFTPClientInterface
setSleepTime
in interface ProFTPClientInterface
sleepTime
- sleep time in secondsCopyright © 2001-2014 Enterprise Distributed Technologies Ltd. All Rights Reserved.