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
ConstructorsModifierConstructorDescriptionprotectedFtpFileSystemConfigBuilder(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.FTPFileEntryParserFactorygetFileType(FileSystemOptions opts) Gets the file type parameter.static FtpFileSystemConfigBuilderGets the singleton instance.getProxy(FileSystemOptions opts) Gets the Proxy.SeeFTPClientConfigfor details and examples.Gets whether to use remote verification.Get the language code used by the server.SeeFTPClientConfigfor details and examples.String[]SeeFTPClientConfigfor details and examples.ReturnsBoolean.TRUEif VFS should treat the user directory as the root directory.voidsetConnectTimeout(FileSystemOptions opts, Integer connectTimeout) Sets the timeout for the initial control connection.voidsetControlEncoding(FileSystemOptions opts, String encoding) SeeFTP.setControlEncoding(java.lang.String)for details and examples.voidsetDataTimeout(FileSystemOptions opts, Integer dataTimeout) Set the data timeout for the ftp client.voidsetDefaultDateFormat(FileSystemOptions opts, String defaultDateFormat) Set the default date format used by the server.voidsetEntryParser(FileSystemOptions opts, String key) Set the FQCN of your FileEntryParser used to parse the directory listing from your server.voidsetEntryParserFactory(FileSystemOptions opts, org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory factory) FTPFileEntryParserFactory which will be used for ftp-entry parsing.voidsetFileType(FileSystemOptions opts, FtpFileType ftpFileType) Sets the file type parameter.voidsetPassiveMode(FileSystemOptions opts, boolean passiveMode) Enter into passive mode.voidsetProxy(FileSystemOptions opts, Proxy proxy) Sets the Proxy.voidsetRecentDateFormat(FileSystemOptions opts, String recentDateFormat) SeeFTPClientConfigfor details and examples.voidsetRemoteVerification(FileSystemOptions opts, boolean remoteVerification) Sets whether to use remote verification.voidsetServerLanguageCode(FileSystemOptions opts, String serverLanguageCode) Set the language code used by the server.voidsetServerTimeZoneId(FileSystemOptions opts, String serverTimeZoneId) SeeFTPClientConfigfor details and examples.voidsetShortMonthNames(FileSystemOptions opts, String[] shortMonthNames) SeeFTPClientConfigfor details and examples.voidsetSoTimeout(FileSystemOptions opts, Integer soTimeout) Sets the socket timeout for the FTP client.voidsetUserDirIsRoot(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:FileSystemConfigBuilderGet the target of this configuration.- Specified by:
getConfigClassin 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. SeeFTPClientConfigfor 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
SeeFTPClientConfigfor 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. SeeFTPClientConfigfor details and examples.- Parameters:
opts- The FilesystemOptions.- Returns:
- The language code of the server.
-
getServerTimeZoneId
SeeFTPClientConfigfor details and examples.- Parameters:
opts- The FileSystemOptions.- Returns:
- The server timezone id.
-
getShortMonthNames
SeeFTPClientConfigfor 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.TRUEif VFS should treat the user directory as the root directory. Defaults toBoolean.TRUEif the methodsetUserDirIsRoot(FileSystemOptions, boolean)has not been invoked.- Parameters:
opts- The FileSystemOptions.- Returns:
Boolean.TRUEif 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
nullno 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
dataTimeouttonull, 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. SeeFTPClientConfigfor 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 modeis activated.- Parameters:
opts- the FileSystem options.proxy- the Proxy- Since:
- 2.1
-
setRecentDateFormat
SeeFTPClientConfigfor 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. SeeFTPClientConfigfor details and examples.- Parameters:
opts- The FileSystemOptions.serverLanguageCode- The servers language code.
-
setServerTimeZoneId
SeeFTPClientConfigfor details and examples.- Parameters:
opts- The FileSystemOptions.serverTimeZoneId- The server timezone id.
-
setShortMonthNames
SeeFTPClientConfigfor 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
soTimeouttonull, 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.
-