Class FtpFileSystemConfigBuilder
java.lang.Object
org.apache.commons.vfs2.FileSystemConfigBuilder
org.apache.commons.vfs2.provider.ftp.FtpFileSystemConfigBuilder
- Direct Known Subclasses:
FtpsFileSystemConfigBuilder
The config builder for various ftp configuration options.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FtpFileSystemConfigBuilder
(String prefix) Create new config builder with specified prefix string. -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<? extends FileSystem>
Get the target of this configuration.Gets the timeout in milliseconds to use for the socket connection.Get the default date format used by the server.org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory
getFileType
(FileSystemOptions opts) Gets the file type parameter.static FtpFileSystemConfigBuilder
Gets the singleton instance.getProxy
(FileSystemOptions opts) Gets the Proxy.SeeFTPClientConfig
for details and examples.Gets whether to use remote verification.Get the language code used by the server.SeeFTPClientConfig
for details and examples.String[]
SeeFTPClientConfig
for details and examples.ReturnsBoolean.TRUE
if VFS should treat the user directory as the root directory.void
setConnectTimeout
(FileSystemOptions opts, Integer connectTimeout) Sets the timeout for the initial control connection.void
setControlEncoding
(FileSystemOptions opts, String encoding) SeeFTP.setControlEncoding(java.lang.String)
for details and examples.void
setDataTimeout
(FileSystemOptions opts, Integer dataTimeout) Set the data timeout for the ftp client.void
setDefaultDateFormat
(FileSystemOptions opts, String defaultDateFormat) Set the default date format used by the server.void
setEntryParser
(FileSystemOptions opts, 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, Proxy proxy) Sets the Proxy.void
setRecentDateFormat
(FileSystemOptions opts, String recentDateFormat) SeeFTPClientConfig
for details and examples.void
setRemoteVerification
(FileSystemOptions opts, boolean remoteVerification) Sets whether to use remote verification.void
setServerLanguageCode
(FileSystemOptions opts, String serverLanguageCode) Set the language code used by the server.void
setServerTimeZoneId
(FileSystemOptions opts, String serverTimeZoneId) SeeFTPClientConfig
for details and examples.void
setShortMonthNames
(FileSystemOptions opts, String[] shortMonthNames) SeeFTPClientConfig
for details and examples.void
setSoTimeout
(FileSystemOptions opts, Integer soTimeout) Sets the socket timeout for the FTP client.void
setUserDirIsRoot
(FileSystemOptions opts, boolean userDirIsRoot) Use user directory as root (do not change to fs root).Methods inherited from class org.apache.commons.vfs2.FileSystemConfigBuilder
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, setRootURI
-
Constructor Details
-
FtpFileSystemConfigBuilder
Create new config builder with specified prefix string.- Parameters:
prefix
- prefix string to use for parameters of this config builder.- Since:
- 2.1
-
-
Method Details
-
getInstance
Gets the singleton instance.- Returns:
- the singleton instance.
-
getConfigClass
Description copied from class:FileSystemConfigBuilder
Get the target of this configuration.- Specified by:
getConfigClass
in classFileSystemConfigBuilder
- Returns:
- the specific file system class
-
getConnectTimeout
Gets the timeout in milliseconds to use for the socket connection.- Parameters:
opts
- The FileSystemOptions.- Returns:
- The timeout in milliseconds to use for the socket connection.
- Since:
- 2.1
-
getControlEncoding
- Parameters:
opts
- The FileSystemOptions.- Returns:
- The encoding.
- Since:
- 2.0
-
getDataTimeout
- Parameters:
opts
- The FileSystemOptions.- Returns:
- The timeout for opening the data channel in milliseconds.
- See Also:
-
getDefaultDateFormat
Get the default date format used by the server. SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions- Returns:
- The default date format.
-
getEntryParser
- Parameters:
opts
- The FileSystemOptions.- Returns:
- the key to the EntryParser.
- See Also:
-
getEntryParserFactory
public org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory getEntryParserFactory(FileSystemOptions opts) - Parameters:
opts
- The FlleSystemOptions.- Returns:
- An FTPFileEntryParserFactory.
- See Also:
-
getFileType
Gets the file type parameter.- Parameters:
opts
- The FileSystemOptions.- Returns:
- A FtpFileType
- Since:
- 2.1
-
getPassiveMode
- Parameters:
opts
- The FileSystemOptions.- Returns:
- true if passive mode is set.
- See Also:
-
getProxy
Gets the Proxy.- Parameters:
opts
- The FileSystemOptions.- Returns:
- the Proxy
- Since:
- 2.1
-
getRecentDateFormat
SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.- Returns:
- The recent date format.
-
getRemoteVerification
Gets whether to use remote verification.- Parameters:
opts
- The FileSystemOptions.- Returns:
- True if remote verification should be done.
-
getServerLanguageCode
Get the language code used by the server. SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FilesystemOptions.- Returns:
- The language code of the server.
-
getServerTimeZoneId
SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.- Returns:
- The server timezone id.
-
getShortMonthNames
SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.- Returns:
- An array of short month names.
-
getSoTimeout
- Parameters:
opts
- The FileSystem options.- Returns:
- The timeout value in milliseconds.
- Since:
- 2.0
- See Also:
-
getUserDirIsRoot
ReturnsBoolean.TRUE
if VFS should treat the user directory as the root directory. Defaults toBoolean.TRUE
if the methodsetUserDirIsRoot(FileSystemOptions, boolean)
has not been invoked.- Parameters:
opts
- The FileSystemOptions.- Returns:
Boolean.TRUE
if VFS treats the user directory as the root directory.- See Also:
-
setConnectTimeout
Sets the timeout for the initial control connection.If you set the connectTimeout to
null
no connectTimeout will be set.- Parameters:
opts
- The FileSystemOptions.connectTimeout
- the timeout value in milliseconds- Since:
- 2.1
-
setControlEncoding
SeeFTP.setControlEncoding(java.lang.String)
for details and examples.- Parameters:
opts
- The FileSystemOptions.encoding
- the encoding to use- Since:
- 2.0
-
setDataTimeout
Set the data timeout for the ftp client.If you set the
dataTimeout
tonull
, no dataTimeout will be set on the ftp client.- Parameters:
opts
- The FileSystemOptions.dataTimeout
- The timeout value.
-
setDefaultDateFormat
Set the default date format used by the server. SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.defaultDateFormat
- The default date format.
-
setEntryParser
Set the FQCN of your FileEntryParser used to parse the directory listing from your server.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.- Parameters:
opts
- The FileSystemOptions.key
- The key.
-
setEntryParserFactory
public void setEntryParserFactory(FileSystemOptions opts, org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory factory) FTPFileEntryParserFactory which will be used for ftp-entry parsing.- Parameters:
opts
- The FileSystemOptions.factory
- instance of your factory
-
setFileType
Sets the file type parameter.- Parameters:
opts
- The FileSystemOptions.ftpFileType
- A FtpFileType- Since:
- 2.1
-
setPassiveMode
Enter into passive mode.- Parameters:
opts
- The FileSystemOptions.passiveMode
- true if passive mode should be used.
-
setProxy
Sets the Proxy.You might need to make sure that
passive mode
is activated.- Parameters:
opts
- the FileSystem options.proxy
- the Proxy- Since:
- 2.1
-
setRecentDateFormat
SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.recentDateFormat
- The recent date format.
-
setRemoteVerification
Sets whether to use remote verification.- Parameters:
opts
- The FileSystemOptions.remoteVerification
- True if verification should be done.
-
setServerLanguageCode
Set the language code used by the server. SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.serverLanguageCode
- The servers language code.
-
setServerTimeZoneId
SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.serverTimeZoneId
- The server timezone id.
-
setShortMonthNames
SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.shortMonthNames
- an array of short month name Strings.
-
setSoTimeout
Sets the socket timeout for the FTP client.If you set the
soTimeout
tonull
, no socket timeout will be set on the ftp client.- Parameters:
opts
- The FileSystem options.soTimeout
- The timeout value in milliseconds.- Since:
- 2.0
-
setUserDirIsRoot
Use user directory as root (do not change to fs root).- Parameters:
opts
- The FileSystemOptions.userDirIsRoot
- true if the user directory should be treated as the root.
-