public class ConnectionContext
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
ConnectionContext() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
int |
getActiveHighPort()
Get the upper limit of the port range for active mode.
|
java.lang.String |
getActiveIPAddress()
The active IP address being used, or null if not used
|
int |
getActiveLowPort()
Get the lower limit of the port range for active mode.
|
FTPConnectMode |
getConnectMode() |
FTPTransferType |
getContentType() |
java.lang.String |
getControlEncoding()
Get the encoding used for the control connection
|
boolean |
getDetectContentType()
Get the detect content type flag
|
DirectoryEmptyStrings |
getDirectoryEmptyMessages()
Get class that holds fragments of server messages that indicate a
directory is empty.
|
FileNotFoundStrings |
getFileNotFoundMessages()
Get class that holds fragments of server messages that indicate a file was
not found.
|
java.util.Locale[] |
getParserLocales() |
java.lang.String |
getPassword() |
java.lang.String |
getRemoteHost() |
int |
getRemotePort() |
int |
getTimeout() |
int |
getTransferBufferSize()
Get the size of the buffers used in writing to and reading from
the data sockets
|
TransferCompleteStrings |
getTransferCompleteMessages()
Get class that holds fragments of server messages that indicate a transfer completed.
|
int |
getTransferNotifyInterval()
Get the interval used for progress notification of transfers.
|
java.lang.String |
getUserName() |
boolean |
isAutoLogin()
Determine if auto login is switched on
|
boolean |
isAutoPassiveIPSubstitution()
Is automatic substitution of the remote host IP set to
be on for passive mode connections?
|
boolean |
isDeleteOnFailure()
If true, delete partially written files when exceptions are thrown
during a download
|
boolean |
isListenOnAllInterfaces()
Are we listening on all interfaces in active mode, which is the default?
|
boolean |
isStrictReturnCodes()
Determine if strict checking of return codes is switched on.
|
void |
setActiveIPAddress(java.lang.String activeIP)
We can force PORT to send a fixed IP address, which can be useful with certain
NAT configurations.
|
void |
setActivePortRange(int lowest,
int highest)
Force a certain range of ports to be used in active mode.
|
void |
setAutoLogin(boolean autoLogin)
Set the autoLogin flag
|
void |
setAutoPassiveIPSubstitution(boolean autoPassiveIPSubstitution)
Set automatic substitution of the remote host IP on if
in passive mode
|
void |
setConnectMode(FTPConnectMode connectMode) |
void |
setContentType(FTPTransferType transferType) |
void |
setControlEncoding(java.lang.String controlEncoding)
Set the encoding used for control channel messages
|
void |
setDeleteOnFailure(boolean deleteOnFailure)
Switch on or off the automatic deletion of partially written files
that are left when an exception is thrown during a download
|
void |
setDetectContentType(boolean detectContentType)
Set autodetect of filetypes on or off.
|
void |
setListenOnAllInterfaces(boolean listenOnAll)
Listen on all interfaces for active mode transfers (the default).
|
void |
setParserLocales(java.util.Locale[] locales)
Set the list of locales to be tried for date parsing of dir listings
|
void |
setPassword(java.lang.String password) |
void |
setRemoteHost(java.lang.String remoteHost) |
void |
setRemotePort(int remotePort) |
void |
setStrictReturnCodes(boolean strict)
Set strict checking of FTP return codes.
|
void |
setTimeout(int timeout) |
void |
setTransferBufferSize(int size)
Set the size of the buffers used in writing to and reading from
the data sockets
|
void |
setTransferNotifyInterval(int notifyInterval)
Set the interval used for progress notification of transfers.
|
void |
setUserName(java.lang.String username) |
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean isAutoLogin()
public void setAutoLogin(boolean autoLogin)
autoLogin
- true if logging in automaticallypublic void setDetectContentType(boolean detectContentType)
detectContentType
- true if detecting transfer mode, false if notpublic boolean getDetectContentType()
public void setActiveIPAddress(java.lang.String activeIP)
activeIP
- IP address to force, in 192.168.1.0 form or in IPV6 form, e.g.
1080::8:800:200C:417Apublic java.lang.String getActiveIPAddress()
public void setActivePortRange(int lowest, int highest)
lowest
- Lower limit of range.highest
- Upper limit of range.public int getActiveLowPort()
public int getActiveHighPort()
public void setStrictReturnCodes(boolean strict)
strict
- true for strict checking, false for loose checkingpublic boolean isStrictReturnCodes()
public boolean isAutoPassiveIPSubstitution()
public void setAutoPassiveIPSubstitution(boolean autoPassiveIPSubstitution)
autoPassiveIPSubstitution
- true if set to on, false otherwisepublic void setListenOnAllInterfaces(boolean listenOnAll)
listenOnAll
- true if listen on all interfaces, false to listen on the control interfacepublic boolean isListenOnAllInterfaces()
public boolean isDeleteOnFailure()
public void setDeleteOnFailure(boolean deleteOnFailure)
deleteOnFailure
- true if delete when a failure occurspublic FTPConnectMode getConnectMode()
public void setConnectMode(FTPConnectMode connectMode)
public void setPassword(java.lang.String password)
public void setRemoteHost(java.lang.String remoteHost)
public void setRemotePort(int remotePort)
public void setUserName(java.lang.String username)
public void setContentType(FTPTransferType transferType)
public FTPTransferType getContentType()
public java.lang.String getPassword()
public java.lang.String getRemoteHost()
public int getRemotePort()
public void setParserLocales(java.util.Locale[] locales)
locales
- locales to usepublic int getTimeout()
public void setTimeout(int timeout)
public java.lang.String getUserName()
public java.util.Locale[] getParserLocales()
public java.lang.String getControlEncoding()
public void setControlEncoding(java.lang.String controlEncoding)
controlEncoding
- The controlEncoding to set, which is the name of a Charsetpublic void setTransferBufferSize(int size)
size
- new size of buffer in bytespublic int getTransferBufferSize()
public int getTransferNotifyInterval()
public void setTransferNotifyInterval(int notifyInterval)
notifyInterval
- number of bytes between each notificationpublic FileNotFoundStrings getFileNotFoundMessages()
The fragments are used when it is necessary to examine the message returned by a server to see if it is saying a file was not found. If an FTP server is returning a different message that still clearly indicates a file was not found, use this property to add a new server fragment to the repository via the add method. It would be helpful to email support at enterprisedt dot com to inform us of the message so it can be added to the next build.
public TransferCompleteStrings getTransferCompleteMessages()
The fragments are used when it is necessary to examine the message returned by a server to see if it is saying a transfer completed. If an FTP server is returning a different message that still clearly indicates a transfer failed, use this property to add a new server fragment to the repository via the add method. It would be helpful to email support at enterprisedt dot com to inform us of the message so it can be added to the next build.
public DirectoryEmptyStrings getDirectoryEmptyMessages()
The fragments are used when it is necessary to examine the message returned by a server to see if it is saying a directory is empty. If an FTP server is returning a different message that still clearly indicates a directory is empty, use this property to add a new server fragment to the repository via the add method. It would be helpful to email support at enterprisedt dot com to inform us of the message so it can be added to the next build.