Class AdvancedFTPSettings
- Version:
- $Revision$
- Author:
- Bruce Blackshaw
-
Method Summary
Modifier and TypeMethodDescriptionGet the account details to be sent at login time for use in the ACCT commandintGet the upper limit of the port range for active mode.The active IP address being used, or null if not usedintGet the lower limit of the port range for active mode.Get the data transfer mode.Get class that holds fragments of server messages that indicate a directory is empty.Get class that holds fragments of server messages that indicate a file was not found.Locale[]Get the current parser locales used for directory listing parsingintGet the retry count for retrying file transfers.intGet the retry delay between retry attempts, in milliseconds.Get class that holds fragments of server messages that indicate a transfer completed.booleanIs automatic substitution of the remote host IP set to be on for passive mode connections?booleanDetermine if strict checking of return codes is switched on.voidsetAccountDetails(String accountDetails) Set the account details to be sent at login time for use in the ACCT command.voidsetActiveIPAddress(String activeIP) We can force PORT to send a fixed IP address, which can be useful with certain NAT configurations.voidsetActivePortRange(int lowest, int highest) Force a certain range of ports to be used in active mode.voidsetAutoPassiveIPSubstitution(boolean autoPassiveIPSubstitution) Set automatic substitution of the remote host IP on if in passive modevoidsetConnectMode(FTPConnectMode mode) Set the data transfer mode to either active (PORT) or passive (PASV).voidsetParserLocales(Locale[] locales) Set the list of locales to be tried for date parsing of directory listingsvoidsetRetryCount(int retryCount) Set the retry count for retrying file transfers.voidsetRetryDelay(int retryDelay) Set the retry delay between retry attempts, in millisecondsvoidsetStrictReturnCodes(boolean strict) Set strict checking of FTP return codes.
-
Method Details
-
getConnectMode
Get the data transfer mode. This only applies to the FTP and FTPS protocols.- Returns:
- the data transfer mode of the master context
-
setConnectMode
Set the data transfer mode to either active (PORT) or passive (PASV). Only applicable to FTP/S. Setting applies to all subsequent transfers that are initiated.- Parameters:
mode- data transfer mode to set- Throws:
FTPException
-
setStrictReturnCodes
public void setStrictReturnCodes(boolean strict) Set strict checking of FTP return codes. If strict checking is on (the default) code must exactly match the expected code. If strict checking is off, only the first digit must match.- Parameters:
strict- true for strict checking, false for loose checking
-
isStrictReturnCodes
public boolean isStrictReturnCodes()Determine if strict checking of return codes is switched on. If it is (the default), all return codes must exactly match the expected code. If strict checking is off, only the first digit must match.- Returns:
- true if strict return code checking, false if non-strict.
-
setParserLocales
Set the list of locales to be tried for date parsing of directory listings- Parameters:
locales- locales to use
-
getParserLocales
Get the current parser locales used for directory listing parsing- Returns:
- Locale[]
-
getAccountDetails
Get the account details to be sent at login time for use in the ACCT command- Returns:
- account details string
-
setAccountDetails
Set the account details to be sent at login time for use in the ACCT command.- Parameters:
accountDetails- account details to set
-
isAutoPassiveIPSubstitution
public boolean isAutoPassiveIPSubstitution()Is automatic substitution of the remote host IP set to be on for passive mode connections?- Returns:
- true if set on, false otherwise
-
setAutoPassiveIPSubstitution
public void setAutoPassiveIPSubstitution(boolean autoPassiveIPSubstitution) Set automatic substitution of the remote host IP on if in passive mode- Parameters:
autoPassiveIPSubstitution- true if set to on, false otherwise
-
setActivePortRange
public void setActivePortRange(int lowest, int highest) Force a certain range of ports to be used in active mode. This is generally so that a port range can be configured in a firewall. Note that if lowest == highest, a single port will be used. This works well for uploads, but downloads generally require multiple ports, as most servers fail to create a connection repeatedly for the same port.- Parameters:
lowest- Lower limit of range (should be >= 1024).highest- Upper limit of range.(should be invalid input: '<'= 65535)
-
getActiveLowPort
public int getActiveLowPort()Get the lower limit of the port range for active mode.- Returns:
- lower limit, or -1 if not set
-
getActiveHighPort
public int getActiveHighPort()Get the upper limit of the port range for active mode.- Returns:
- upper limit, or -1 if not set
-
setActiveIPAddress
We can force PORT to send a fixed IP address, which can be useful with certain NAT configurations.- Parameters:
activeIP- IP address to force, in 192.168.1.0 form or in IPV6 form, e.g. 1080::8:800:200C:417A
-
getActiveIPAddress
The active IP address being used, or null if not used- Returns:
- IP address as a string or null
-
getRetryCount
public int getRetryCount()Get the retry count for retrying file transfers. Default is 3 attempts.- Returns:
- number of times a transfer is retried
-
setRetryCount
public void setRetryCount(int retryCount) Set the retry count for retrying file transfers.- Parameters:
retryCount- new retry count
-
getRetryDelay
public int getRetryDelay()Get the retry delay between retry attempts, in milliseconds. Default is 5000.- Returns:
- retry delay in milliseconds
-
setRetryDelay
public void setRetryDelay(int retryDelay) Set the retry delay between retry attempts, in milliseconds- Parameters:
new- retry delay in milliseconds
-
getFileNotFoundMessages
Get class that holds fragments of server messages that indicate a file was not found. New messages can be added.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.
- Returns:
- messages class
-
getTransferCompleteMessages
Get class that holds fragments of server messages that indicate a transfer completed. New messages can be added.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.
- Returns:
- messages class
-
getDirectoryEmptyMessages
Get class that holds fragments of server messages that indicate a directory is empty. New messages can be added.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.
- Returns:
- messages class
-