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
ConstructorsModifierConstructorDescriptionprotectedConstruct builder with default prefix.protectedFileSystemConfigBuilder(String component) Construct builder with specified component name. -
Method Summary
Modifier and TypeMethodDescriptionprotected BooleangetBoolean(FileSystemOptions opts, String name) Get named option as boolean.protected booleangetBoolean(FileSystemOptions opts, String name, boolean defaultValue) Get named option as boolean.protected BooleangetBoolean(FileSystemOptions opts, String name, Boolean defaultValue) Get named option as boolean.protected BytegetByte(FileSystemOptions opts, String name) Get named option as byte.protected bytegetByte(FileSystemOptions opts, String name, byte defaultValue) Get named option as byte.protected BytegetByte(FileSystemOptions opts, String name, Byte defaultValue) Get named option as byte.protected CharactergetCharacter(FileSystemOptions opts, String name) Get named option as character.protected chargetCharacter(FileSystemOptions opts, String name, char defaultValue) Get named option as character.protected CharactergetCharacter(FileSystemOptions opts, String name, Character defaultValue) Get named option as character.protected abstract Class<? extends FileSystem>Get the target of this configuration.protected DoublegetDouble(FileSystemOptions opts, String name) Get named option as double.protected doublegetDouble(FileSystemOptions opts, String name, double defaultValue) Get named option as double.protected DoublegetDouble(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 FloatgetFloat(FileSystemOptions opts, String name) Get named option as float.protected floatgetFloat(FileSystemOptions opts, String name, float defaultValue) Get named option as float.protected FloatgetFloat(FileSystemOptions opts, String name, Float defaultValue) Get named option as float.protected IntegergetInteger(FileSystemOptions opts, String name) Get named option as integer.protected intgetInteger(FileSystemOptions opts, String name, int defaultValue) Get named option as integer.protected IntegergetInteger(FileSystemOptions opts, String name, Integer defaultValue) Get named option as integer.protected LonggetLong(FileSystemOptions opts, String name) Get named option as long.protected longgetLong(FileSystemOptions opts, String name, long defaultValue) Get named option as long.protected LonggetLong(FileSystemOptions opts, String name, Long defaultValue) Get named option as long.protected ObjectgetParam(FileSystemOptions opts, String name) Get named parameter.getRootURI(FileSystemOptions opts) Return the root URI of the file system.protected ShortgetShort(FileSystemOptions opts, String name) Get named option as short.protected shortgetShort(FileSystemOptions opts, String name, short defaultValue) Get named option as short.protected ShortgetShort(FileSystemOptions opts, String name, Short defaultValue) Get named option as short.protected StringgetString(FileSystemOptions opts, String name) Get named option as String.protected StringgetString(FileSystemOptions opts, String name, String defaultValue) Get named option as String.protected booleanhasObject(FileSystemOptions opts, String name) Is named setting specified.protected booleanhasParam(FileSystemOptions opts, String name) Check if option exists.protected voidsetParam(FileSystemOptions opts, String name, boolean value) Set named parameter.protected voidsetParam(FileSystemOptions opts, String name, Object value) Set named parameter.voidsetRootURI(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 inoptsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor 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
optsor system properties, otherwisedefaultValue - Since:
- 2.0
-
getConfigClass
Get the target of this configuration.- Returns:
- the specific file system class
- Since:
- 1.0
-