public class FtpFileSystemConfigBuilder extends FileSystemConfigBuilder
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
_PREFIX |
private static java.lang.String |
AUTODETECT_UTF8 |
private static FtpFileSystemConfigBuilder |
BUILDER |
private static java.lang.String |
CONNECT_TIMEOUT |
private static java.lang.String |
DATA_TIMEOUT |
private static java.lang.String |
DEFAULT_DATE_FORMAT |
private static java.lang.String |
ENCODING |
private static java.lang.String |
FACTORY_KEY |
private static java.lang.String |
FILE_TYPE |
private static java.lang.String |
PASSIVE_MODE |
private static java.lang.String |
PROXY |
private static java.lang.String |
RECENT_DATE_FORMAT |
private static java.lang.String |
REMOTE_VERIFICATION |
private static java.lang.String |
SERVER_LANGUAGE_CODE |
private static java.lang.String |
SERVER_TIME_ZONE_ID |
private static java.lang.String |
SHORT_MONTH_NAMES |
private static java.lang.String |
SO_TIMEOUT |
private static java.lang.String |
TRANSFER_ABORTED_OK_REPLY_CODES |
private static java.lang.String |
USER_DIR_IS_ROOT |
| Modifier | Constructor and Description |
|---|---|
private |
FtpFileSystemConfigBuilder() |
protected |
FtpFileSystemConfigBuilder(java.lang.String prefix)
Create new config builder with specified prefix string.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Boolean |
getAutodetectUtf8(FileSystemOptions opts)
Gets whether to try to autodetect the server encoding (only UTF8 is supported).
|
protected java.lang.Class<? extends FileSystem> |
getConfigClass()
Gets the target of this configuration.
|
java.lang.Integer |
getConnectTimeout(FileSystemOptions opts)
Gets the timeout in milliseconds to use for the socket connection.
|
java.lang.String |
getControlEncoding(FileSystemOptions opts) |
java.lang.Integer |
getDataTimeout(FileSystemOptions opts) |
java.lang.String |
getDefaultDateFormat(FileSystemOptions opts)
Get the default date format used by the server.
|
java.lang.String |
getEntryParser(FileSystemOptions opts) |
org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory |
getEntryParserFactory(FileSystemOptions opts) |
FtpFileType |
getFileType(FileSystemOptions opts)
Gets the file type parameter.
|
static FtpFileSystemConfigBuilder |
getInstance()
Gets the singleton instance.
|
java.lang.Boolean |
getPassiveMode(FileSystemOptions opts) |
java.net.Proxy |
getProxy(FileSystemOptions opts)
Gets the Proxy.
|
java.lang.String |
getRecentDateFormat(FileSystemOptions opts)
See
FTPClientConfig for details and examples. |
java.lang.Boolean |
getRemoteVerification(FileSystemOptions opts)
Gets whether to use remote verification.
|
static java.util.List<java.lang.Integer> |
getSaneTransferAbortedOkReplyCodes() |
java.lang.String |
getServerLanguageCode(FileSystemOptions opts)
Get the language code used by the server.
|
java.lang.String |
getServerTimeZoneId(FileSystemOptions opts)
See
FTPClientConfig for details and examples. |
java.lang.String[] |
getShortMonthNames(FileSystemOptions opts)
See
FTPClientConfig for details and examples. |
java.lang.Integer |
getSoTimeout(FileSystemOptions opts) |
java.util.List<java.lang.Integer> |
getTransferAbortedOkReplyCodes(FileSystemOptions opts) |
java.lang.Boolean |
getUserDirIsRoot(FileSystemOptions opts)
Returns
Boolean.TRUE if VFS should treat the user directory as the root directory. |
void |
setAutodetectUtf8(FileSystemOptions opts,
java.lang.Boolean autodetectUTF8)
Sets whether to try to autodetect the server encoding (only UTF8 is supported).
|
void |
setConnectTimeout(FileSystemOptions opts,
java.lang.Integer connectTimeout)
Sets the timeout for the initial control connection.
|
void |
setControlEncoding(FileSystemOptions opts,
java.lang.String encoding)
See
FTP.setControlEncoding(java.lang.String) for details and examples. |
void |
setDataTimeout(FileSystemOptions opts,
java.lang.Integer dataTimeout)
Set the data timeout for the ftp client.
|
void |
setDefaultDateFormat(FileSystemOptions opts,
java.lang.String defaultDateFormat)
Set the default date format used by the server.
|
void |
setEntryParser(FileSystemOptions opts,
java.lang.String key)
Set the FQCN of your FileEntryParser used to parse the directory listing from your server.
|
void |
setEntryParserFactory(FileSystemOptions opts,
org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory factory)
FTPFileEntryParserFactory which will be used for ftp-entry parsing.
|
void |
setFileType(FileSystemOptions opts,
FtpFileType ftpFileType)
Sets the file type parameter.
|
void |
setPassiveMode(FileSystemOptions opts,
boolean passiveMode)
Enter into passive mode.
|
void |
setProxy(FileSystemOptions opts,
java.net.Proxy proxy)
Sets the Proxy.
|
void |
setRecentDateFormat(FileSystemOptions opts,
java.lang.String recentDateFormat)
See
FTPClientConfig for details and examples. |
void |
setRemoteVerification(FileSystemOptions opts,
boolean remoteVerification)
Sets whether to use remote verification.
|
void |
setServerLanguageCode(FileSystemOptions opts,
java.lang.String serverLanguageCode)
Set the language code used by the server.
|
void |
setServerTimeZoneId(FileSystemOptions opts,
java.lang.String serverTimeZoneId)
See
FTPClientConfig for details and examples. |
void |
setShortMonthNames(FileSystemOptions opts,
java.lang.String[] shortMonthNames)
See
FTPClientConfig for details and examples. |
void |
setSoTimeout(FileSystemOptions opts,
java.lang.Integer soTimeout)
Sets the socket timeout for the FTP client.
|
void |
setTransferAbortedOkReplyCodes(FileSystemOptions opts,
java.util.List<java.lang.Integer> replyCodes)
Sets the list of reply codes that are considered as OK when prematurely closing a stream.
|
void |
setUserDirIsRoot(FileSystemOptions opts,
boolean userDirIsRoot)
Use user directory as root (do not change to fs root).
|
getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCharacter, getCharacter, getCharacter, getDouble, getDouble, getDouble, getEnum, getEnum, getFloat, getFloat, getFloat, getInteger, getInteger, getInteger, getLong, getLong, getLong, getParam, getRootURI, getShort, getShort, getShort, getString, getString, hasObject, hasParam, setParam, setParam, setRootURIprivate static final java.lang.String _PREFIX
private static final FtpFileSystemConfigBuilder BUILDER
private static final java.lang.String AUTODETECT_UTF8
private static final java.lang.String CONNECT_TIMEOUT
private static final java.lang.String DATA_TIMEOUT
private static final java.lang.String DEFAULT_DATE_FORMAT
private static final java.lang.String ENCODING
private static final java.lang.String FACTORY_KEY
private static final java.lang.String FILE_TYPE
private static final java.lang.String PASSIVE_MODE
private static final java.lang.String PROXY
private static final java.lang.String RECENT_DATE_FORMAT
private static final java.lang.String REMOTE_VERIFICATION
private static final java.lang.String SERVER_LANGUAGE_CODE
private static final java.lang.String SERVER_TIME_ZONE_ID
private static final java.lang.String SHORT_MONTH_NAMES
private static final java.lang.String SO_TIMEOUT
private static final java.lang.String USER_DIR_IS_ROOT
private static final java.lang.String TRANSFER_ABORTED_OK_REPLY_CODES
private FtpFileSystemConfigBuilder()
protected FtpFileSystemConfigBuilder(java.lang.String prefix)
prefix - prefix string to use for parameters of this config builder.public static FtpFileSystemConfigBuilder getInstance()
protected java.lang.Class<? extends FileSystem> getConfigClass()
FileSystemConfigBuildergetConfigClass in class FileSystemConfigBuilderpublic static java.util.List<java.lang.Integer> getSaneTransferAbortedOkReplyCodes()
public java.lang.Boolean getAutodetectUtf8(FileSystemOptions opts)
opts - The FileSystemOptions.public java.lang.Integer getConnectTimeout(FileSystemOptions opts)
opts - The FileSystemOptions.public java.lang.String getControlEncoding(FileSystemOptions opts)
opts - The FileSystemOptions.public java.lang.Integer getDataTimeout(FileSystemOptions opts)
opts - The FileSystemOptions.setDataTimeout(org.apache.commons.vfs2.FileSystemOptions, java.lang.Integer)public java.lang.String getDefaultDateFormat(FileSystemOptions opts)
FTPClientConfig for
details and examples.opts - The FileSystemOptionspublic java.lang.String getEntryParser(FileSystemOptions opts)
opts - The FileSystemOptions.setEntryParser(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)public org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory getEntryParserFactory(FileSystemOptions opts)
opts - The FlleSystemOptions.setEntryParserFactory(org.apache.commons.vfs2.FileSystemOptions, org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory)public FtpFileType getFileType(FileSystemOptions opts)
opts - The FileSystemOptions.public java.lang.Boolean getPassiveMode(FileSystemOptions opts)
opts - The FileSystemOptions.setPassiveMode(org.apache.commons.vfs2.FileSystemOptions, boolean)public java.net.Proxy getProxy(FileSystemOptions opts)
opts - The FileSystemOptions.public java.lang.String getRecentDateFormat(FileSystemOptions opts)
FTPClientConfig for details and examples.opts - The FileSystemOptions.public java.lang.Boolean getRemoteVerification(FileSystemOptions opts)
opts - The FileSystemOptions.public java.lang.String getServerLanguageCode(FileSystemOptions opts)
FTPClientConfig for details and
examples.opts - The FilesystemOptions.public java.lang.String getServerTimeZoneId(FileSystemOptions opts)
FTPClientConfig for details and examples.opts - The FileSystemOptions.public java.lang.String[] getShortMonthNames(FileSystemOptions opts)
FTPClientConfig for details and examples.opts - The FileSystemOptions.public java.lang.Integer getSoTimeout(FileSystemOptions opts)
opts - The FileSystem options.getDataTimeout(org.apache.commons.vfs2.FileSystemOptions)public java.lang.Boolean getUserDirIsRoot(FileSystemOptions opts)
Boolean.TRUE if VFS should treat the user directory as the root directory. Defaults to
Boolean.TRUE if the method setUserDirIsRoot(FileSystemOptions, boolean) has not been
invoked.opts - The FileSystemOptions.Boolean.TRUE if VFS treats the user directory as the root directory.setUserDirIsRoot(org.apache.commons.vfs2.FileSystemOptions, boolean)public java.util.List<java.lang.Integer> getTransferAbortedOkReplyCodes(FileSystemOptions opts)
opts - The FileSystem options.public void setAutodetectUtf8(FileSystemOptions opts, java.lang.Boolean autodetectUTF8)
opts - The FileSystemOptions.autodetectUTF8 - true if autodetection should be done.public void setConnectTimeout(FileSystemOptions opts, java.lang.Integer connectTimeout)
If you set the connectTimeout to null no connectTimeout will be set.
opts - The FileSystemOptions.connectTimeout - the timeout value in millisecondspublic void setControlEncoding(FileSystemOptions opts, java.lang.String encoding)
FTP.setControlEncoding(java.lang.String) for details and examples.opts - The FileSystemOptions.encoding - the encoding to usepublic void setDataTimeout(FileSystemOptions opts, java.lang.Integer dataTimeout)
If you set the dataTimeout to null, no dataTimeout will be set on the ftp client.
opts - The FileSystemOptions.dataTimeout - The timeout value.public void setDefaultDateFormat(FileSystemOptions opts, java.lang.String defaultDateFormat)
FTPClientConfig for
details and examples.opts - The FileSystemOptions.defaultDateFormat - The default date format.public void setEntryParser(FileSystemOptions opts, java.lang.String key)
If you do not use the default commons-net FTPFileEntryParserFactory e.g. by using setEntryParserFactory(org.apache.commons.vfs2.FileSystemOptions, org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory)
this is the "key" parameter passed as argument into your custom factory.
opts - The FileSystemOptions.key - The key.public void setEntryParserFactory(FileSystemOptions opts, org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory factory)
opts - The FileSystemOptions.factory - instance of your factorypublic void setFileType(FileSystemOptions opts, FtpFileType ftpFileType)
opts - The FileSystemOptions.ftpFileType - A FtpFileTypepublic void setPassiveMode(FileSystemOptions opts, boolean passiveMode)
opts - The FileSystemOptions.passiveMode - true if passive mode should be used.public void setProxy(FileSystemOptions opts, java.net.Proxy proxy)
You might need to make sure that passive mode is activated.
opts - the FileSystem options.proxy - the Proxypublic void setRecentDateFormat(FileSystemOptions opts, java.lang.String recentDateFormat)
FTPClientConfig for details and examples.opts - The FileSystemOptions.recentDateFormat - The recent date format.public void setRemoteVerification(FileSystemOptions opts, boolean remoteVerification)
opts - The FileSystemOptions.remoteVerification - True if verification should be done.public void setServerLanguageCode(FileSystemOptions opts, java.lang.String serverLanguageCode)
FTPClientConfig for details and
examples.opts - The FileSystemOptions.serverLanguageCode - The servers language code.public void setServerTimeZoneId(FileSystemOptions opts, java.lang.String serverTimeZoneId)
FTPClientConfig for details and examples.opts - The FileSystemOptions.serverTimeZoneId - The server timezone id.public void setShortMonthNames(FileSystemOptions opts, java.lang.String[] shortMonthNames)
FTPClientConfig for details and examples.opts - The FileSystemOptions.shortMonthNames - an array of short month name Strings.public void setSoTimeout(FileSystemOptions opts, java.lang.Integer soTimeout)
If you set the soTimeout to null, no socket timeout will be set on the ftp client.
opts - The FileSystem options.soTimeout - The timeout value in milliseconds.public void setUserDirIsRoot(FileSystemOptions opts, boolean userDirIsRoot)
opts - The FileSystemOptions.userDirIsRoot - true if the user directory should be treated as the root.public void setTransferAbortedOkReplyCodes(FileSystemOptions opts, java.util.List<java.lang.Integer> replyCodes)
If you set the replyCodes to an empty list, all reply codes besides 200 will be
considered as an error.
opts - The FileSystem options.replyCodes - The reply codes.