Class FtpFileSystemConfigBuilder
- java.lang.Object
-
- org.apache.commons.vfs2.FileSystemConfigBuilder
-
- org.apache.commons.vfs2.provider.ftp.FtpFileSystemConfigBuilder
-
- Direct Known Subclasses:
FtpsFileSystemConfigBuilder
public class FtpFileSystemConfigBuilder extends FileSystemConfigBuilder
The config builder for various ftp configuration options.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FtpFileSystemConfigBuilder(java.lang.String prefix)
Create new config builder with specified prefix string.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Class<? extends FileSystem>
getConfigClass()
Get 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)
SeeFTPClientConfig
for details and examples.java.lang.Boolean
getRemoteVerification(FileSystemOptions opts)
Gets whether to use remote verification.java.lang.String
getServerLanguageCode(FileSystemOptions opts)
Get the language code used by the server.java.lang.String
getServerTimeZoneId(FileSystemOptions opts)
SeeFTPClientConfig
for details and examples.java.lang.String[]
getShortMonthNames(FileSystemOptions opts)
SeeFTPClientConfig
for details and examples.java.lang.Integer
getSoTimeout(FileSystemOptions opts)
java.lang.Boolean
getUserDirIsRoot(FileSystemOptions opts)
ReturnsBoolean.TRUE
if VFS should treat the user directory as the root directory.void
setConnectTimeout(FileSystemOptions opts, java.lang.Integer connectTimeout)
Sets the timeout for the initial control connection.void
setControlEncoding(FileSystemOptions opts, java.lang.String encoding)
SeeFTP.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)
SeeFTPClientConfig
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)
SeeFTPClientConfig
for details and examples.void
setShortMonthNames(FileSystemOptions opts, java.lang.String[] shortMonthNames)
SeeFTPClientConfig
for details and examples.void
setSoTimeout(FileSystemOptions opts, java.lang.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 Detail
-
FtpFileSystemConfigBuilder
protected FtpFileSystemConfigBuilder(java.lang.String prefix)
Create new config builder with specified prefix string.- Parameters:
prefix
- prefix string to use for parameters of this config builder.- Since:
- 2.1
-
-
Method Detail
-
getInstance
public static FtpFileSystemConfigBuilder getInstance()
Gets the singleton instance.- Returns:
- the singleton instance.
-
getConfigClass
protected java.lang.Class<? extends FileSystem> getConfigClass()
Description copied from class:FileSystemConfigBuilder
Get the target of this configuration.- Specified by:
getConfigClass
in classFileSystemConfigBuilder
- Returns:
- the specific file system class
-
getConnectTimeout
public java.lang.Integer getConnectTimeout(FileSystemOptions opts)
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
public java.lang.String getControlEncoding(FileSystemOptions opts)
- Parameters:
opts
- The FileSystemOptions.- Returns:
- The encoding.
- Since:
- 2.0
-
getDataTimeout
public java.lang.Integer getDataTimeout(FileSystemOptions opts)
- Parameters:
opts
- The FileSystemOptions.- Returns:
- The timeout for opening the data channel in milliseconds.
- See Also:
setDataTimeout(org.apache.commons.vfs2.FileSystemOptions, java.lang.Integer)
-
getDefaultDateFormat
public java.lang.String getDefaultDateFormat(FileSystemOptions opts)
Get the default date format used by the server. SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions- Returns:
- The default date format.
-
getEntryParser
public java.lang.String getEntryParser(FileSystemOptions opts)
- Parameters:
opts
- The FileSystemOptions.- Returns:
- the key to the EntryParser.
- See Also:
setEntryParser(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)
-
getEntryParserFactory
public org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory getEntryParserFactory(FileSystemOptions opts)
- Parameters:
opts
- The FlleSystemOptions.- Returns:
- An FTPFileEntryParserFactory.
- See Also:
setEntryParserFactory(org.apache.commons.vfs2.FileSystemOptions, org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory)
-
getFileType
public FtpFileType getFileType(FileSystemOptions opts)
Gets the file type parameter.- Parameters:
opts
- The FileSystemOptions.- Returns:
- A FtpFileType
- Since:
- 2.1
-
getPassiveMode
public java.lang.Boolean getPassiveMode(FileSystemOptions opts)
- Parameters:
opts
- The FileSystemOptions.- Returns:
- true if passive mode is set.
- See Also:
setPassiveMode(org.apache.commons.vfs2.FileSystemOptions, boolean)
-
getProxy
public java.net.Proxy getProxy(FileSystemOptions opts)
Gets the Proxy.- Parameters:
opts
- The FileSystemOptions.- Returns:
- the Proxy
- Since:
- 2.1
-
getRecentDateFormat
public java.lang.String getRecentDateFormat(FileSystemOptions opts)
SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.- Returns:
- The recent date format.
-
getRemoteVerification
public java.lang.Boolean getRemoteVerification(FileSystemOptions opts)
Gets whether to use remote verification.- Parameters:
opts
- The FileSystemOptions.- Returns:
- True if remote verification should be done.
-
getServerLanguageCode
public java.lang.String getServerLanguageCode(FileSystemOptions opts)
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
public java.lang.String getServerTimeZoneId(FileSystemOptions opts)
SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.- Returns:
- The server timezone id.
-
getShortMonthNames
public java.lang.String[] getShortMonthNames(FileSystemOptions opts)
SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.- Returns:
- An array of short month names.
-
getSoTimeout
public java.lang.Integer getSoTimeout(FileSystemOptions opts)
- Parameters:
opts
- The FileSystem options.- Returns:
- The timeout value in milliseconds.
- Since:
- 2.0
- See Also:
getDataTimeout(org.apache.commons.vfs2.FileSystemOptions)
-
getUserDirIsRoot
public java.lang.Boolean getUserDirIsRoot(FileSystemOptions opts)
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:
setUserDirIsRoot(org.apache.commons.vfs2.FileSystemOptions, boolean)
-
setConnectTimeout
public void setConnectTimeout(FileSystemOptions opts, java.lang.Integer connectTimeout)
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
public void setControlEncoding(FileSystemOptions opts, java.lang.String encoding)
SeeFTP.setControlEncoding(java.lang.String)
for details and examples.- Parameters:
opts
- The FileSystemOptions.encoding
- the encoding to use- Since:
- 2.0
-
setDataTimeout
public void setDataTimeout(FileSystemOptions opts, java.lang.Integer dataTimeout)
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
public void setDefaultDateFormat(FileSystemOptions opts, java.lang.String defaultDateFormat)
Set the default date format used by the server. SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.defaultDateFormat
- The default date format.
-
setEntryParser
public void setEntryParser(FileSystemOptions opts, java.lang.String key)
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
public void setFileType(FileSystemOptions opts, FtpFileType ftpFileType)
Sets the file type parameter.- Parameters:
opts
- The FileSystemOptions.ftpFileType
- A FtpFileType- Since:
- 2.1
-
setPassiveMode
public void setPassiveMode(FileSystemOptions opts, boolean passiveMode)
Enter into passive mode.- Parameters:
opts
- The FileSystemOptions.passiveMode
- true if passive mode should be used.
-
setProxy
public void setProxy(FileSystemOptions opts, java.net.Proxy proxy)
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
public void setRecentDateFormat(FileSystemOptions opts, java.lang.String recentDateFormat)
SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.recentDateFormat
- The recent date format.
-
setRemoteVerification
public void setRemoteVerification(FileSystemOptions opts, boolean remoteVerification)
Sets whether to use remote verification.- Parameters:
opts
- The FileSystemOptions.remoteVerification
- True if verification should be done.
-
setServerLanguageCode
public void setServerLanguageCode(FileSystemOptions opts, java.lang.String serverLanguageCode)
Set the language code used by the server. SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.serverLanguageCode
- The servers language code.
-
setServerTimeZoneId
public void setServerTimeZoneId(FileSystemOptions opts, java.lang.String serverTimeZoneId)
SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.serverTimeZoneId
- The server timezone id.
-
setShortMonthNames
public void setShortMonthNames(FileSystemOptions opts, java.lang.String[] shortMonthNames)
SeeFTPClientConfig
for details and examples.- Parameters:
opts
- The FileSystemOptions.shortMonthNames
- an array of short month name Strings.
-
setSoTimeout
public void setSoTimeout(FileSystemOptions opts, java.lang.Integer soTimeout)
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
public void setUserDirIsRoot(FileSystemOptions opts, boolean userDirIsRoot)
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.
-
-