Package org.apache.commons.vfs2
Class FileSystemConfigBuilder
java.lang.Object
org.apache.commons.vfs2.FileSystemConfigBuilder
- Direct Known Subclasses:
DefaultFileSystemConfigBuilder
,FtpFileSystemConfigBuilder
,HttpFileSystemConfigBuilder
,RamFileSystemConfigBuilder
,ResourceFileSystemConfigBuilder
,SftpFileSystemConfigBuilder
Abstract class which has the right to fill FileSystemOptions.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Construct builder with default prefix.protected
FileSystemConfigBuilder
(String component) Construct builder with specified component name. -
Method Summary
Modifier and TypeMethodDescriptionprotected Boolean
getBoolean
(FileSystemOptions opts, String name) Get named option as boolean.protected boolean
getBoolean
(FileSystemOptions opts, String name, boolean defaultValue) Get named option as boolean.protected Boolean
getBoolean
(FileSystemOptions opts, String name, Boolean defaultValue) Get named option as boolean.protected Byte
getByte
(FileSystemOptions opts, String name) Get named option as byte.protected byte
getByte
(FileSystemOptions opts, String name, byte defaultValue) Get named option as byte.protected Byte
getByte
(FileSystemOptions opts, String name, Byte defaultValue) Get named option as byte.protected Character
getCharacter
(FileSystemOptions opts, String name) Get named option as character.protected char
getCharacter
(FileSystemOptions opts, String name, char defaultValue) Get named option as character.protected Character
getCharacter
(FileSystemOptions opts, String name, Character defaultValue) Get named option as character.protected abstract Class<? extends FileSystem>
Get the target of this configuration.protected Double
getDouble
(FileSystemOptions opts, String name) Get named option as double.protected double
getDouble
(FileSystemOptions opts, String name, double defaultValue) Get named option as double.protected Double
getDouble
(FileSystemOptions opts, String name, Double defaultValue) Get named option as double.protected <E extends Enum<E>>
EgetEnum
(Class<E> enumClass, FileSystemOptions opts, String name) Get named option as enumeration.protected <E extends Enum<E>>
EgetEnum
(Class<E> enumClass, FileSystemOptions opts, String name, E defaultValue) Get named option as enumeration.protected Float
getFloat
(FileSystemOptions opts, String name) Get named option as float.protected float
getFloat
(FileSystemOptions opts, String name, float defaultValue) Get named option as float.protected Float
getFloat
(FileSystemOptions opts, String name, Float defaultValue) Get named option as float.protected Integer
getInteger
(FileSystemOptions opts, String name) Get named option as integer.protected int
getInteger
(FileSystemOptions opts, String name, int defaultValue) Get named option as integer.protected Integer
getInteger
(FileSystemOptions opts, String name, Integer defaultValue) Get named option as integer.protected Long
getLong
(FileSystemOptions opts, String name) Get named option as long.protected long
getLong
(FileSystemOptions opts, String name, long defaultValue) Get named option as long.protected Long
getLong
(FileSystemOptions opts, String name, Long defaultValue) Get named option as long.protected Object
getParam
(FileSystemOptions opts, String name) Get named parameter.getRootURI
(FileSystemOptions opts) Return the root URI of the file system.protected Short
getShort
(FileSystemOptions opts, String name) Get named option as short.protected short
getShort
(FileSystemOptions opts, String name, short defaultValue) Get named option as short.protected Short
getShort
(FileSystemOptions opts, String name, Short defaultValue) Get named option as short.protected String
getString
(FileSystemOptions opts, String name) Get named option as String.protected String
getString
(FileSystemOptions opts, String name, String defaultValue) Get named option as String.protected boolean
hasObject
(FileSystemOptions opts, String name) Is named setting specified.protected boolean
hasParam
(FileSystemOptions opts, String name) Check if option exists.protected void
setParam
(FileSystemOptions opts, String name, boolean value) Set named parameter.protected void
setParam
(FileSystemOptions opts, String name, Object value) Set named parameter.void
setRootURI
(FileSystemOptions opts, String rootURI) The root URI of the file system.
-
Constructor Details
-
FileSystemConfigBuilder
protected FileSystemConfigBuilder()Construct builder with default prefix.- Since:
- 1.0
-
FileSystemConfigBuilder
Construct builder with specified component name.- Parameters:
component
- component name to be used in prefix- Since:
- 2.0
-
-
Method Details
-
setRootURI
The root URI of the file system.- Parameters:
opts
- the file system options to modifyrootURI
- The creator name to be associated with the file.- Since:
- 2.0
-
getRootURI
Return the root URI of the file system.- Parameters:
opts
- file system options to work with- Returns:
- The root URI
- Since:
- 2.0
-
setParam
Set named parameter.- Parameters:
opts
- the file system options to modifyname
- set option with this namevalue
- boolean value to set- Since:
- 2.1
-
setParam
Set named parameter.- Parameters:
opts
- the file system options to modifyname
- set option with this namevalue
- object value to set- Since:
- 1.0
-
getParam
Get named parameter.- Parameters:
opts
- file system options to work withname
- get option with this name- Returns:
- the named option or null
- Since:
- 1.0
-
hasParam
Check if option exists.- Parameters:
opts
- file system options to work withname
- the name to look up inopts
- Returns:
- true if opts have the named parameter
- Since:
- 1.0
-
hasObject
Is named setting specified.- Parameters:
opts
- file system options to work withname
- the option to check inopts
or system properties- Returns:
- true if option exists
- Since:
- 2.0
-
getBoolean
Get named option as boolean.- Parameters:
opts
- file system options to work withname
- the option name- Returns:
- the option in
opts
or system properties, otherwise null - Since:
- 2.0
- See Also:
-
getBoolean
Get named option as boolean.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Since:
- 2.0
- See Also:
-
getBoolean
Get named option as boolean.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Since:
- 2.0
- See Also:
-
getByte
Get named option as byte.- Parameters:
opts
- file system options to work withname
- the option name- Returns:
- the option in
opts
or system properties, otherwise null - Since:
- 2.0
- See Also:
-
getByte
Get named option as byte.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Since:
- 2.0
- See Also:
-
getByte
Get named option as byte.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Since:
- 2.0
-
getCharacter
Get named option as character.- Parameters:
opts
- file system options to work withname
- the option name- Returns:
- the option in
opts
or system properties, otherwise null - Since:
- 2.0
- See Also:
-
getCharacter
Get named option as character.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Since:
- 2.0
- See Also:
-
getCharacter
Get named option as character.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Since:
- 2.0
-
getDouble
Get named option as double.- Parameters:
opts
- file system options to work withname
- the option name- Returns:
- the option in
opts
or system properties, otherwise null - Since:
- 2.0
- See Also:
-
getDouble
Get named option as double.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Since:
- 2.0
- See Also:
-
getDouble
Get named option as double.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Since:
- 2.0
-
getEnum
Get named option as enumeration.- Type Parameters:
E
- enumeration type- Parameters:
enumClass
- class of enumeration typeopts
- file system options to work withname
- the option name *- Returns:
- the option in
opts
or system properties, otherwise null - Throws:
IllegalArgumentException
- if option value is not a known enumeration.- Since:
- 2.1
- See Also:
-
getEnum
protected <E extends Enum<E>> E getEnum(Class<E> enumClass, FileSystemOptions opts, String name, E defaultValue) Get named option as enumeration.- Type Parameters:
E
- enumeration type- Parameters:
enumClass
- class of enumeration typeopts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Throws:
IllegalArgumentException
- if option value is not a known enumeration.- Since:
- 2.1
- See Also:
-
getFloat
Get named option as float.- Parameters:
opts
- file system options to work withname
- the option name- Returns:
- the option in
opts
or system properties, otherwise null - Throws:
NumberFormatException
- if option value is not a valid float.- Since:
- 2.0
- See Also:
-
getFloat
Get named option as float.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Throws:
NumberFormatException
- if option value is not a valid float.- Since:
- 2.0
- See Also:
-
getFloat
Get named option as float.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Throws:
NumberFormatException
- if option value is not a valid float.- Since:
- 2.0
-
getInteger
Get named option as integer.- Parameters:
opts
- file system options to work withname
- the option name- Returns:
- the option in
opts
or system properties, otherwise null - Throws:
NumberFormatException
- if option value is not a valid integer.- Since:
- 2.0
- See Also:
-
getInteger
Get named option as integer.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Throws:
NumberFormatException
- if option value is not a valid integer.- Since:
- 2.0
- See Also:
-
getInteger
Get named option as integer.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Throws:
NumberFormatException
- if option value is not a valid integer.- Since:
- 2.0
-
getLong
Get named option as long.- Parameters:
opts
- file system options to work withname
- the option name- Returns:
- the option in
opts
or system properties, otherwise null - Throws:
NumberFormatException
- if option value is not a valid long.- Since:
- 2.0
- See Also:
-
getLong
Get named option as long.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Throws:
NumberFormatException
- if option value is not a valid long.- Since:
- 2.0
- See Also:
-
getLong
Get named option as long.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Throws:
NumberFormatException
- if option value is not a valid long.- Since:
- 2.0
-
getShort
Get named option as short.- Parameters:
opts
- file system options to work withname
- the option name- Returns:
- the option in
opts
or system properties, otherwise null - Throws:
NumberFormatException
- if option value is not a valid short.- Since:
- 2.0
- See Also:
-
getShort
Get named option as short.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Throws:
NumberFormatException
- if option value is not a valid short- Since:
- 2.0
- See Also:
-
getShort
Get named option as short.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Throws:
NumberFormatException
- if option value is not a valid short- Since:
- 2.0
-
getString
Get named option as String.- Parameters:
opts
- file system options to work withname
- the option name- Returns:
- the option in
opts
or system properties, otherwise null - Since:
- 2.0
- See Also:
-
getString
Get named option as String.- Parameters:
opts
- file system options to work withname
- the option namedefaultValue
- value to return if option is not present- Returns:
- the option in
opts
or system properties, otherwisedefaultValue
- Since:
- 2.0
-
getConfigClass
Get the target of this configuration.- Returns:
- the specific file system class
- Since:
- 1.0
-