Class FtpFileSystemConfigBuilder
- Direct Known Subclasses:
FtpsFileSystemConfigBuilder
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FtpFileSystemConfigBuilder
(String prefix) Create new config builder with specified prefix string. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.lang3.Range<Integer>
getActivePortRange
(FileSystemOptions options) Gets the active port range.getAutodetectUtf8
(FileSystemOptions options) Gets whether to try to autodetect the server encoding (only UTF8 is supported).protected Class<? extends FileSystem>
Gets the target of this configuration.getConnectTimeout
(FileSystemOptions options) Deprecated.Gets the timeout in milliseconds to use for the socket connection.getControlEncoding
(FileSystemOptions options) Gets the control encoding.Gets the controlKeepAliveReplyTimeout duration.Gets the controlKeepAliveTimeout duration.getDataTimeout
(FileSystemOptions options) Deprecated.getDataTimeoutDuration
(FileSystemOptions options) Gets the timeout for opening the data channel.getDefaultDateFormat
(FileSystemOptions options) Gets the default date format used by the server.getEntryParser
(FileSystemOptions options) Gets the key to the EntryParser.org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory
getEntryParserFactory
(FileSystemOptions options) Gets the FTPFileEntryParserFactory parameter.getFileType
(FileSystemOptions options) Gets the file type parameter.static FtpFileSystemConfigBuilder
Gets the singleton instance.getMdtmLastModifiedTime
(FileSystemOptions options) Gets the option to use FTP MDTM forFileContent.getLastModifiedTime()
.getPassiveMode
(FileSystemOptions options) Tests whether passive mode is set.getProxy
(FileSystemOptions options) Gets the Proxy.getRecentDateFormat
(FileSystemOptions options) SeeFTPClientConfig
for details and examples.getRemoteVerification
(FileSystemOptions options) Gets whether to use remote verification.Gets special retry code.getServerLanguageCode
(FileSystemOptions options) Gets the language code used by the server.getServerTimeZoneId
(FileSystemOptions options) SeeFTPClientConfig
for details and examples.String[]
getShortMonthNames
(FileSystemOptions options) SeeFTPClientConfig
for details and examples.getSoTimeout
(FileSystemOptions options) Deprecated.getSoTimeoutDuration
(FileSystemOptions options) Gets The so timeout duration.Gets the list of reply codes (apart from 200) that are considered as OK when prematurely closing a stream.getUserDirIsRoot
(FileSystemOptions options) Tests whether if VFS should treat the user directory as the root directory.void
setActivePortRange
(FileSystemOptions options, org.apache.commons.lang3.Range<Integer> portRange) Sets the active port range.void
setAutodetectUtf8
(FileSystemOptions options, Boolean autodetectUTF8) Sets whether to try to autodetect the server encoding (only UTF8 is supported).void
setConnectTimeout
(FileSystemOptions options, Integer duration) Deprecated.void
setConnectTimeout
(FileSystemOptions options, Duration duration) Sets the timeout for the initial control connection.void
setControlEncoding
(FileSystemOptions options, String encoding) SeeFTP.setControlEncoding(java.lang.String)
for details and examples.void
setControlKeepAliveReplyTimeout
(FileSystemOptions options, Duration duration) Sets the control keep alive reply timeout for the FTP client.void
setControlKeepAliveTimeout
(FileSystemOptions options, Duration duration) Sets the control keep alive timeout for the FTP client.void
setDataTimeout
(FileSystemOptions options, Integer duration) Deprecated.void
setDataTimeout
(FileSystemOptions options, Duration duration) Sets the data timeout for the FTP client.void
setDefaultDateFormat
(FileSystemOptions options, String defaultDateFormat) Sets the default date format used by the server.void
setEntryParser
(FileSystemOptions options, String key) Sets the FQCN of your FileEntryParser used to parse the directory listing from your server.void
setEntryParserFactory
(FileSystemOptions options, org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory factory) FTPFileEntryParserFactory which will be used for ftp-entry parsing.void
setFileType
(FileSystemOptions options, FtpFileType ftpFileType) Sets the file type parameter.void
setMdtmLastModifiedTime
(FileSystemOptions options, boolean mdtm) Sets the option to use FTP MDTM forFileContent.getLastModifiedTime()
.void
setPassiveMode
(FileSystemOptions options, boolean passiveMode) Enter into passive mode.void
setProxy
(FileSystemOptions options, Proxy proxy) Sets the Proxy.void
setRecentDateFormat
(FileSystemOptions options, String recentDateFormat) SeeFTPClientConfig
for details and examples.void
setRemoteVerification
(FileSystemOptions options, boolean remoteVerification) Sets whether to use remote verification.void
setServerLanguageCode
(FileSystemOptions options, String serverLanguageCode) Sets the language code used by the server.void
setServerTimeZoneId
(FileSystemOptions options, String serverTimeZoneId) SeeFTPClientConfig
for details and examples.void
setShortMonthNames
(FileSystemOptions options, String[] shortMonthNames) SeeFTPClientConfig
for details and examples.void
setSoTimeout
(FileSystemOptions options, Integer timeout) Deprecated.void
setSoTimeout
(FileSystemOptions options, Duration timeout) Sets the socket timeout for the FTP client.void
setTransferAbortedOkReplyCodes
(FileSystemOptions options, List<Integer> replyCodes) Sets the list of reply codes that are considered as OK when prematurely closing a stream.void
setUserDirIsRoot
(FileSystemOptions options, 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, getDuration, getDuration, getDurationInteger, getDurationInteger, getEnum, getEnum, getFloat, getFloat, getFloat, getInteger, getInteger, getInteger, getLong, getLong, getLong, getParam, getParamOrDefault, getRootURI, getShort, getShort, getShort, getString, getString, hasObject, hasParam, setParam, setParam, setRootURI, toBooleanObject
-
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.
-
getSaneTransferAbortedOkReplyCodes
Gets special retry code. See VFS-674, its accompanying PR and https://github.com/apache/commons-vfs/pull/51 as to why 426 and 550 are here.- Returns:
- special retry code.
-
getActivePortRange
Gets the active port range.- Parameters:
options
- The FileSystemOptions.- Returns:
- the Range of active ports
- Since:
- 2.10.0
-
getAutodetectUtf8
Gets whether to try to autodetect the server encoding (only UTF8 is supported).- Parameters:
options
- The FileSystemOptions.- Returns:
- True if autodetection should be done.
- Since:
- 2.4
-
getConfigClass
Description copied from class:FileSystemConfigBuilder
Gets the target of this configuration.- Specified by:
getConfigClass
in classFileSystemConfigBuilder
- Returns:
- the specific file system class
-
getConnectTimeout
Deprecated.Gets the timeout in milliseconds to use for the socket connection.- Parameters:
options
- The FileSystemOptions.- Returns:
- The timeout in milliseconds to use for the socket connection.
- Since:
- 2.1
-
getConnectTimeoutDuration
Gets the timeout in milliseconds to use for the socket connection.- Parameters:
options
- The FileSystemOptions.- Returns:
- The timeout in milliseconds to use for the socket connection.
- Since:
- 2.8.0
-
getControlEncoding
Gets the control encoding.- Parameters:
options
- The FileSystemOptions.- Returns:
- The control encoding.
- Since:
- 2.0
-
getControlKeepAliveReplyTimeout
Gets the controlKeepAliveReplyTimeout duration.- Parameters:
options
- The FileSystem options- Returns:
- The controlKeepAliveReplyTimeout duration.
- Since:
- 2.8.0
-
getControlKeepAliveTimeout
Gets the controlKeepAliveTimeout duration.- Parameters:
options
- The FileSystem options- Returns:
- The controlKeepAliveTimeout duration.
- Since:
- 2.8.0
-
getDataTimeout
Deprecated.Gets timeout for opening the data channel in milliseconds.- Parameters:
options
- The FileSystemOptions.- Returns:
- The timeout for opening the data channel in milliseconds.
- See Also:
-
getDataTimeoutDuration
Gets the timeout for opening the data channel.- Parameters:
options
- The FileSystemOptions.- Returns:
- The timeout for opening the data channel.
- Since:
- 2.8.0
- See Also:
-
getDefaultDateFormat
Gets the default date format used by the server. SeeFTPClientConfig
for details and examples.- Parameters:
options
- The FileSystemOptions- Returns:
- The default date format.
-
getEntryParser
Gets the key to the EntryParser.- Parameters:
options
- The FileSystemOptions.- Returns:
- the key to the EntryParser.
- See Also:
-
getEntryParserFactory
public org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory getEntryParserFactory(FileSystemOptions options) Gets the FTPFileEntryParserFactory parameter.- Parameters:
options
- The FileSystemOptions.- Returns:
- The FTPFileEntryParserFactory parameter.
- See Also:
-
getFileType
Gets the file type parameter.- Parameters:
options
- The FileSystemOptions.- Returns:
- A FtpFileType
- Since:
- 2.1
-
getMdtmLastModifiedTime
Gets the option to use FTP MDTM forFileContent.getLastModifiedTime()
.- Parameters:
options
- The FileSystemOptions.- Returns:
- true if MDTM should be used.
- Since:
- 2.8.0
-
getPassiveMode
Tests whether passive mode is set.- Parameters:
options
- The FileSystemOptions.- Returns:
- whether passive mode is set.
- See Also:
-
getProxy
Gets the Proxy.- Parameters:
options
- The FileSystemOptions.- Returns:
- the Proxy
- Since:
- 2.1
-
getRecentDateFormat
SeeFTPClientConfig
for details and examples.- Parameters:
options
- The FileSystemOptions.- Returns:
- The recent date format.
-
getRemoteVerification
Gets whether to use remote verification.- Parameters:
options
- The FileSystemOptions.- Returns:
- True if remote verification should be done.
-
getServerLanguageCode
Gets the language code used by the server. SeeFTPClientConfig
for details and examples.- Parameters:
options
- The FilesystemOptions.- Returns:
- The language code of the server.
-
getServerTimeZoneId
SeeFTPClientConfig
for details and examples.- Parameters:
options
- The FileSystemOptions.- Returns:
- The server timezone id.
-
getShortMonthNames
SeeFTPClientConfig
for details and examples.- Parameters:
options
- The FileSystemOptions.- Returns:
- An array of short month names.
-
getSoTimeout
Deprecated.Gets The so timeout duration in milliseconds.- Parameters:
options
- The FileSystem options.- Returns:
- The so timeout duration in milliseconds.
- Since:
- 2.0
- See Also:
-
getSoTimeoutDuration
Gets The so timeout duration.- Parameters:
options
- The FileSystem options.- Returns:
- The timeout value in milliseconds.
- Since:
- 2.8.0
- See Also:
-
getTransferAbortedOkReplyCodes
Gets the list of reply codes (apart from 200) that are considered as OK when prematurely closing a stream.- Parameters:
options
- The FileSystem options.- Returns:
- The list of reply codes (apart from 200) that are considered as OK when prematurely closing a stream.
- Since:
- 2.4
-
getUserDirIsRoot
Tests whether if VFS should treat the user directory as the root directory. Defaults toBoolean.TRUE
if the methodsetUserDirIsRoot(FileSystemOptions, boolean)
has not been invoked.- Parameters:
options
- The FileSystemOptions.- Returns:
Boolean.TRUE
if VFS treats the user directory as the root directory.- See Also:
-
setActivePortRange
public void setActivePortRange(FileSystemOptions options, org.apache.commons.lang3.Range<Integer> portRange) Sets the active port range.- Parameters:
options
- The FileSystemOptions.portRange
- the Range of active ports- Since:
- 2.10.0
-
setAutodetectUtf8
Sets whether to try to autodetect the server encoding (only UTF8 is supported).- Parameters:
options
- The FileSystemOptions.autodetectUTF8
- true if autodetection should be done.- Since:
- 2.4
-
setConnectTimeout
Sets the timeout for the initial control connection.If you set the connectTimeout to
null
no connectTimeout will be set.- Parameters:
options
- The FileSystemOptions.duration
- the timeout duration in milliseconds- Since:
- 2.8.0
-
setConnectTimeout
Deprecated.Sets the timeout for the initial control connection.If you set the connectTimeout to
null
no connectTimeout will be set.- Parameters:
options
- The FileSystemOptions.duration
- the timeout duration.- Since:
- 2.1
-
setControlEncoding
SeeFTP.setControlEncoding(java.lang.String)
for details and examples.- Parameters:
options
- The FileSystemOptions.encoding
- the encoding to use- Since:
- 2.0
-
setControlKeepAliveReplyTimeout
Sets the control keep alive reply timeout for the FTP client.- Parameters:
options
- The FileSystem options.duration
- timeout duration.- Since:
- 2.8.0
-
setControlKeepAliveTimeout
Sets the control keep alive timeout for the FTP client.Sets the
controlKeepAliveTimeout
to ensure the socket be alive after download huge file.- Parameters:
options
- The FileSystem options.duration
- The timeout duration.- Since:
- 2.8.0
-
setDataTimeout
Sets the data timeout for the FTP client.If you set the
dataTimeout
tonull
, no dataTimeout will be set on the FTP client.- Parameters:
options
- The FileSystemOptions.duration
- The timeout duration.- Since:
- 2.8.0
-
setDataTimeout
Deprecated.Sets the data timeout for the FTP client.If you set the
dataTimeout
tonull
, no dataTimeout will be set on the FTP client.- Parameters:
options
- The FileSystemOptions.duration
- The timeout value.
-
setDefaultDateFormat
Sets the default date format used by the server. SeeFTPClientConfig
for details and examples.- Parameters:
options
- The FileSystemOptions.defaultDateFormat
- The default date format.
-
setEntryParser
Sets 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:
options
- The FileSystemOptions.key
- The key.
-
setEntryParserFactory
public void setEntryParserFactory(FileSystemOptions options, org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory factory) FTPFileEntryParserFactory which will be used for ftp-entry parsing.- Parameters:
options
- The FileSystemOptions.factory
- instance of your factory
-
setFileType
Sets the file type parameter.- Parameters:
options
- The FileSystemOptions.ftpFileType
- A FtpFileType- Since:
- 2.1
-
setMdtmLastModifiedTime
Sets the option to use FTP MDTM forFileContent.getLastModifiedTime()
.- Parameters:
options
- The FileSystemOptions.mdtm
- true if MDTM should be used.- Since:
- 2.8.0
-
setPassiveMode
Enter into passive mode.- Parameters:
options
- 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:
options
- the FileSystem options.proxy
- the Proxy- Since:
- 2.1
-
setRecentDateFormat
SeeFTPClientConfig
for details and examples.- Parameters:
options
- The FileSystemOptions.recentDateFormat
- The recent date format.
-
setRemoteVerification
Sets whether to use remote verification.- Parameters:
options
- The FileSystemOptions.remoteVerification
- True if verification should be done.
-
setServerLanguageCode
Sets the language code used by the server. SeeFTPClientConfig
for details and examples.- Parameters:
options
- The FileSystemOptions.serverLanguageCode
- The servers language code.
-
setServerTimeZoneId
SeeFTPClientConfig
for details and examples.- Parameters:
options
- The FileSystemOptions.serverTimeZoneId
- The server timezone id.
-
setShortMonthNames
SeeFTPClientConfig
for details and examples.- Parameters:
options
- 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:
options
- The FileSystem options.timeout
- The timeout value in milliseconds.- Since:
- 2.8.0
-
setSoTimeout
Deprecated.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:
options
- The FileSystem options.timeout
- The timeout value in milliseconds.- Since:
- 2.0
-
setTransferAbortedOkReplyCodes
Sets the list of reply codes that are considered as OK when prematurely closing a stream.If you set the
replyCodes
to an empty list, all reply codes besides 200 will be considered as an error.- Parameters:
options
- The FileSystem options.replyCodes
- The reply codes.- Since:
- 2.4
-
setUserDirIsRoot
Use user directory as root (do not change to fs root).- Parameters:
options
- The FileSystemOptions.userDirIsRoot
- true if the user directory should be treated as the root.
-
getConnectTimeoutDuration(FileSystemOptions)
.