Class FtpFileSystemConfigBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final FtpFileSystemConfigBuilderprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateprotectedFtpFileSystemConfigBuilder(String prefix) Create new config builder with specified prefix string. -
Method Summary
Modifier and TypeMethodDescriptiongetAutodetectUtf8(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) getDataTimeout(FileSystemOptions options) Deprecated.getDataTimeoutDuration(FileSystemOptions options) Gets the timeout for opening the data channel.getDefaultDateFormat(FileSystemOptions options) Get the default date format used by the server.getEntryParser(FileSystemOptions options) org.apache.commons.net.ftp.parser.FTPFileEntryParserFactorygetEntryParserFactory(FileSystemOptions options) getFileType(FileSystemOptions options) Gets the file type parameter.static FtpFileSystemConfigBuilderGets the singleton instance.getMdtmLastModifiedTime(FileSystemOptions options) Gets the option to use FTP MDTM forFileContent.getLastModifiedTime().getPassiveMode(FileSystemOptions options) getProxy(FileSystemOptions options) Gets the Proxy.getRecentDateFormat(FileSystemOptions options) SeeFTPClientConfigfor details and examples.getRemoteVerification(FileSystemOptions options) Gets whether to use remote verification.getServerLanguageCode(FileSystemOptions options) Get the language code used by the server.getServerTimeZoneId(FileSystemOptions options) SeeFTPClientConfigfor details and examples.String[]getShortMonthNames(FileSystemOptions options) SeeFTPClientConfigfor details and examples.getSoTimeout(FileSystemOptions options) Deprecated.getSoTimeoutDuration(FileSystemOptions options) Gets The so timeout duration.getUserDirIsRoot(FileSystemOptions options) ReturnsBoolean.TRUEif VFS should treat the user directory as the root directory.voidsetAutodetectUtf8(FileSystemOptions options, Boolean autodetectUTF8) Sets whether to try to autodetect the server encoding (only UTF8 is supported).voidsetConnectTimeout(FileSystemOptions options, Integer duration) Deprecated.voidsetConnectTimeout(FileSystemOptions options, Duration duration) Sets the timeout for the initial control connection.voidsetControlEncoding(FileSystemOptions options, String encoding) SeeFTP.setControlEncoding(Charset)for details and examples.voidsetControlKeepAliveReplyTimeout(FileSystemOptions options, Duration duration) Sets the control keep alive reply timeout for the FTP client.voidsetControlKeepAliveTimeout(FileSystemOptions options, Duration duration) Sets the control keep alive timeout for the FTP client.voidsetDataTimeout(FileSystemOptions options, Integer duration) Deprecated.voidsetDataTimeout(FileSystemOptions options, Duration duration) Set the data timeout for the FTP client.voidsetDefaultDateFormat(FileSystemOptions options, String defaultDateFormat) Set the default date format used by the server.voidsetEntryParser(FileSystemOptions options, String key) Set the FQCN of your FileEntryParser used to parse the directory listing from your server.voidsetEntryParserFactory(FileSystemOptions options, org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory factory) FTPFileEntryParserFactory which will be used for ftp-entry parsing.voidsetFileType(FileSystemOptions options, FtpFileType ftpFileType) Sets the file type parameter.voidsetMdtmLastModifiedTime(FileSystemOptions options, boolean mdtm) Sets the option to use FTP MDTM forFileContent.getLastModifiedTime().voidsetPassiveMode(FileSystemOptions options, boolean passiveMode) Enter into passive mode.voidsetProxy(FileSystemOptions options, Proxy proxy) Sets the Proxy.voidsetRecentDateFormat(FileSystemOptions options, String recentDateFormat) SeeFTPClientConfigfor details and examples.voidsetRemoteVerification(FileSystemOptions options, boolean remoteVerification) Sets whether to use remote verification.voidsetServerLanguageCode(FileSystemOptions options, String serverLanguageCode) Set the language code used by the server.voidsetServerTimeZoneId(FileSystemOptions options, String serverTimeZoneId) SeeFTPClientConfigfor details and examples.voidsetShortMonthNames(FileSystemOptions options, String[] shortMonthNames) SeeFTPClientConfigfor details and examples.voidsetSoTimeout(FileSystemOptions options, Integer timeout) Deprecated.voidsetSoTimeout(FileSystemOptions options, Duration timeout) Sets the socket timeout for the FTP client.voidsetTransferAbortedOkReplyCodes(FileSystemOptions options, List<Integer> replyCodes) Sets the list of reply codes that are considered as OK when prematurely closing a stream.voidsetUserDirIsRoot(FileSystemOptions options, boolean userDirIsRoot) Use user directory as root (do not change to fs root).Methods inherited from class 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, getRootURI, getShort, getShort, getShort, getString, getString, hasObject, hasParam, setParam, setParam, setRootURI, toBooleanObject
-
Field Details
-
_PREFIX
-
BUILDER
-
AUTODETECT_UTF8
-
CONNECT_TIMEOUT
-
DATA_TIMEOUT
-
DEFAULT_DATE_FORMAT
-
ENCODING
-
FACTORY_KEY
-
FILE_TYPE
-
PASSIVE_MODE
-
PROXY
-
RECENT_DATE_FORMAT
-
REMOTE_VERIFICATION
-
SERVER_LANGUAGE_CODE
-
SERVER_TIME_ZONE_ID
-
SHORT_MONTH_NAMES
-
SO_TIMEOUT
-
CONTROL_KEEP_ALIVE_TIMEOUT
-
CONTROL_KEEP_ALIVE_REPLY_TIMEOUT
-
USER_DIR_IS_ROOT
-
TRANSFER_ABORTED_OK_REPLY_CODES
-
MDTM_LAST_MODIFED_TIME
-
-
Constructor Details
-
FtpFileSystemConfigBuilder
private FtpFileSystemConfigBuilder() -
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
-
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:FileSystemConfigBuilderGets the target of this configuration.- Specified by:
getConfigClassin 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
- Parameters:
options- The FileSystemOptions.- Returns:
- The encoding.
- Since:
- 2.0
-
getControlKeepAliveReplyTimeout
- Parameters:
options- The FileSystem options- Returns:
- The controlKeepAliveReplyTimeout value.
- Since:
- 2.8.0
-
getControlKeepAliveTimeout
- Parameters:
options- The FileSystem options- Returns:
- The controlKeepAliveTimeout value.
- Since:
- 2.8.0
-
getDataTimeout
Deprecated.- 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
Get the default date format used by the server. SeeFTPClientConfigfor details and examples.- Parameters:
options- The FileSystemOptions- Returns:
- The default date format.
-
getEntryParser
- Parameters:
options- The FileSystemOptions.- Returns:
- the key to the EntryParser.
- See Also:
-
getEntryParserFactory
public org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory getEntryParserFactory(FileSystemOptions options) - Parameters:
options- The FlleSystemOptions.- Returns:
- An FTPFileEntryParserFactory.
- 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
- Parameters:
options- The FileSystemOptions.- Returns:
- true if passive mode is set.
- See Also:
-
getProxy
Gets the Proxy.- Parameters:
options- The FileSystemOptions.- Returns:
- the Proxy
- Since:
- 2.1
-
getRecentDateFormat
SeeFTPClientConfigfor 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
Get the language code used by the server. SeeFTPClientConfigfor details and examples.- Parameters:
options- The FilesystemOptions.- Returns:
- The language code of the server.
-
getServerTimeZoneId
SeeFTPClientConfigfor details and examples.- Parameters:
options- The FileSystemOptions.- Returns:
- The server timezone id.
-
getShortMonthNames
SeeFTPClientConfigfor 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
- 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
ReturnsBoolean.TRUEif VFS should treat the user directory as the root directory. Defaults toBoolean.TRUEif the methodsetUserDirIsRoot(FileSystemOptions, boolean)has not been invoked.- Parameters:
options- The FileSystemOptions.- Returns:
Boolean.TRUEif VFS treats the user directory as the root directory.- See Also:
-
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
nullno 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
nullno connectTimeout will be set.- Parameters:
options- The FileSystemOptions.duration- the timeout duration.- Since:
- 2.1
-
setControlEncoding
SeeFTP.setControlEncoding(Charset)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.Set the
controlKeepAliveTimeoutto ensure the socket be alive after download huge file.- Parameters:
options- The FileSystem options.duration- The timeout duration.- Since:
- 2.8.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:
options- The FileSystemOptions.duration- The timeout duration.- Since:
- 2.8.0
-
setDataTimeout
Deprecated.Set the data timeout for the FTP client.If you set the
dataTimeouttonull, no dataTimeout will be set on the FTP client.- Parameters:
options- The FileSystemOptions.duration- The timeout value.
-
setDefaultDateFormat
Set the default date format used by the server. SeeFTPClientConfigfor details and examples.- Parameters:
options- 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(FileSystemOptions, 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 modeis activated.- Parameters:
options- the FileSystem options.proxy- the Proxy- Since:
- 2.1
-
setRecentDateFormat
SeeFTPClientConfigfor 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
Set the language code used by the server. SeeFTPClientConfigfor details and examples.- Parameters:
options- The FileSystemOptions.serverLanguageCode- The servers language code.
-
setServerTimeZoneId
SeeFTPClientConfigfor details and examples.- Parameters:
options- The FileSystemOptions.serverTimeZoneId- The server timezone id.
-
setShortMonthNames
SeeFTPClientConfigfor 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
soTimeouttonull, 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
soTimeouttonull, 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
replyCodesto 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).