Package org.apache.commons.vfs2
Class FileSystemConfigBuilder
java.lang.Object
org.apache.commons.vfs2.FileSystemConfigBuilder
- Direct Known Subclasses:
- DefaultFileSystemConfigBuilder,- FtpFileSystemConfigBuilder,- Http4FileSystemConfigBuilder,- Http5FileSystemConfigBuilder,- HttpFileSystemConfigBuilder,- RamFileSystemConfigBuilder,- ResourceFileSystemConfigBuilder,- SftpFileSystemConfigBuilder,- ZipFileSystemConfigBuilder
Abstracts configuring 
FileSystemOptionss.- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConstructs builder with default prefix.protectedFileSystemConfigBuilder(String component) Constructs builder with specified component name.
- 
Method SummaryModifier and TypeMethodDescriptionprotected BooleangetBoolean(FileSystemOptions fileSystemOptions, String name) Gets a named option as a Boolean.protected booleangetBoolean(FileSystemOptions fileSystemOptions, String name, boolean defaultValue) Gets a named option as a Boolean.protected BooleangetBoolean(FileSystemOptions fileSystemOptions, String name, Boolean defaultValue) Gets a named option as a Boolean.protected BytegetByte(FileSystemOptions fileSystemOptions, String name) Gets a named option as a Byte.protected bytegetByte(FileSystemOptions fileSystemOptions, String name, byte defaultValue) Gets a named option as a Byte.protected BytegetByte(FileSystemOptions fileSystemOptions, String name, Byte defaultValue) Gets a named option as a Byte.protected CharactergetCharacter(FileSystemOptions fileSystemOptions, String name) Gets a named option as a Character.protected chargetCharacter(FileSystemOptions fileSystemOptions, String name, char defaultValue) Gets a named option as a Character.protected CharactergetCharacter(FileSystemOptions fileSystemOptions, String name, Character defaultValue) Gets a named option as a Character.protected abstract Class<? extends FileSystem> Gets the target of this configuration.protected DoublegetDouble(FileSystemOptions fileSystemOptions, String name) Gets a named option as a Double.protected doublegetDouble(FileSystemOptions fileSystemOptions, String name, double defaultValue) Gets a named option as a Double.protected DoublegetDouble(FileSystemOptions fileSystemOptions, String name, Double defaultValue) Gets a named option as a Double.protected DurationgetDuration(FileSystemOptions fileSystemOptions, String name) Gets a named option as a Duration.protected DurationgetDuration(FileSystemOptions fileSystemOptions, String name, Duration defaultValue) Gets a named option as a Duration.protected IntegergetDurationInteger(FileSystemOptions fileSystemOptions, String name) Gets a named option as a Duration bound to the integer range.protected IntegergetDurationInteger(FileSystemOptions fileSystemOptions, String name, Duration defaultValue) Gets a named option as a Duration bound to the integer range.protected <E extends Enum<E>>
 EgetEnum(Class<E> enumClass, FileSystemOptions fileSystemOptions, String name) Gets a named option as a Double.protected <E extends Enum<E>>
 EgetEnum(Class<E> enumClass, FileSystemOptions fileSystemOptions, String name, E defaultValue) Gets a named option as an Enum.protected FloatgetFloat(FileSystemOptions fileSystemOptions, String name) Gets a named option as a Float.protected floatgetFloat(FileSystemOptions fileSystemOptions, String name, float defaultValue) Gets a named option as a Float.protected FloatgetFloat(FileSystemOptions fileSystemOptions, String name, Float defaultValue) Gets a named option as a Float.protected IntegergetInteger(FileSystemOptions fileSystemOptions, String name) Gets a named option as an Integer.protected intgetInteger(FileSystemOptions fileSystemOptions, String name, int defaultValue) Gets a named option as an Integer.protected IntegergetInteger(FileSystemOptions fileSystemOptions, String name, Integer defaultValue) Gets a named option as an Integer.protected LonggetLong(FileSystemOptions fileSystemOptions, String name) Gets a named option as a Long.protected longgetLong(FileSystemOptions fileSystemOptions, String name, long defaultValue) Gets a named option as a Long.protected LonggetLong(FileSystemOptions fileSystemOptions, String name, Long defaultValue) Gets a named option as a Long.protected <T> TgetParam(FileSystemOptions fileSystemOptions, String name) Gets a named parameter.protected <T> TgetParamOrDefault(FileSystemOptions fileSystemOptions, String name, T defaultValue) Gets a named parameter.getRootURI(FileSystemOptions fileSystemOptions) Gets the root URI of the file system.protected ShortgetShort(FileSystemOptions fileSystemOptions, String name) Gets a named option as a Short.protected shortgetShort(FileSystemOptions fileSystemOptions, String name, short defaultValue) Gets a named option as a Short.protected ShortgetShort(FileSystemOptions fileSystemOptions, String name, Short defaultValue) Gets a named option as a Short.protected StringgetString(FileSystemOptions fileSystemOptions, String name) Gets a named option as a String.protected StringgetString(FileSystemOptions fileSystemOptions, String name, String defaultValue) Gets a named option as a String.protected booleanhasObject(FileSystemOptions fileSystemOptions, String name) Checks the named setting specified.protected booleanhasParam(FileSystemOptions fileSystemOptions, String name) Checks if option exists.protected voidsetParam(FileSystemOptions fileSystemOptions, String name, boolean value) Sets the named parameter.protected voidsetParam(FileSystemOptions fileSystemOptions, String name, Object value) Sets the named parameter.voidsetRootURI(FileSystemOptions fileSystemOptions, String rootURI) Sets the root URI of the file system.protected BooleantoBooleanObject(boolean value) Converts the given primitive boolean to a Boolean object.
- 
Constructor Details- 
FileSystemConfigBuilderprotected FileSystemConfigBuilder()Constructs builder with default prefix.- Since:
- 1.0
 
- 
FileSystemConfigBuilderConstructs builder with specified component name.- Parameters:
- component- component name to be used in prefix
- Since:
- 2.0
 
 
- 
- 
Method Details- 
getBooleanGets a named option as a Boolean.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- Returns:
- the option in optsor system properties, otherwise null
- Since:
- 2.0
- See Also:
 
- 
getBooleanprotected boolean getBoolean(FileSystemOptions fileSystemOptions, String name, boolean defaultValue) Gets a named option as a Boolean.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- value to return if option is not present
- Returns:
- the option in optsor system properties, otherwisedefaultValue
- Since:
- 2.0
- See Also:
 
- 
getBooleanprotected Boolean getBoolean(FileSystemOptions fileSystemOptions, String name, Boolean defaultValue) Gets a named option as a Boolean.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- value to return if option is not present
- Returns:
- the option in optsor system properties, otherwisedefaultValue
- Since:
- 2.0
- See Also:
 
- 
getByteGets a named option as a Byte.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- Returns:
- the option in optsor system properties, otherwise null
- Since:
- 2.0
- See Also:
 
- 
getByteGets a named option as a Byte.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- value to return if option is not present
- Returns:
- the option in optsor system properties, otherwisedefaultValue
- Since:
- 2.0
- See Also:
 
- 
getByteGets a named option as a Byte.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- value to return if option is not present
- Returns:
- the option in optsor system properties, otherwisedefaultValue
- Since:
- 2.0
 
- 
getCharacterGets a named option as a Character.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- Returns:
- the option in optsor system properties, otherwise null
- Since:
- 2.0
- See Also:
 
- 
getCharacterGets a named option as a Character.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- value to return if option is not present
- Returns:
- the option in optsor system properties, otherwisedefaultValue
- Since:
- 2.0
- See Also:
 
- 
getCharacterprotected Character getCharacter(FileSystemOptions fileSystemOptions, String name, Character defaultValue) Gets a named option as a Character.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- value to return if option is not present
- Returns:
- the option in optsor system properties, otherwisedefaultValue
- Since:
- 2.0
 
- 
getConfigClassGets the target of this configuration.- Returns:
- the specific file system class
- Since:
- 1.0
 
- 
getDoubleGets a named option as a Double.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- Returns:
- the option in optsor system properties, otherwise null
- Since:
- 2.0
- See Also:
 
- 
getDoubleGets a named option as a Double.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- value to return if option is not present
- Returns:
- the option in optsor system properties, otherwisedefaultValue
- Since:
- 2.0
- See Also:
 
- 
getDoubleGets a named option as a Double.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- value to return if option is not present
- Returns:
- the option in optsor system properties, otherwisedefaultValue
- Since:
- 2.0
 
- 
getDurationGets a named option as a Duration.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- Returns:
- the option in optsor system properties, otherwise null
- Since:
- 2.8.0
- See Also:
 
- 
getDurationprotected Duration getDuration(FileSystemOptions fileSystemOptions, String name, Duration defaultValue) Gets a named option as a Duration.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- value to return if option is not present
- Returns:
- the option in optsor system properties, otherwisedefaultValue
- Since:
- 2.8.0
 
- 
getDurationIntegerGets a named option as a Duration bound to the integer range.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- Returns:
- the option in optsor system properties, otherwise null
- Since:
- 2.8.0
- See Also:
 
- 
getDurationIntegerprotected Integer getDurationInteger(FileSystemOptions fileSystemOptions, String name, Duration defaultValue) Gets a named option as a Duration bound to the integer range.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- value to return if option is not present
- Returns:
- the option in optsor system properties, otherwisedefaultValue
- Since:
- 2.8.0
 
- 
getEnumprotected <E extends Enum<E>> E getEnum(Class<E> enumClass, FileSystemOptions fileSystemOptions, String name) Gets a named option as a Double.- Type Parameters:
- E- enumeration type
- Parameters:
- enumClass- class of enumeration type
- fileSystemOptions- file system options to query, may be null.
- name- 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:
 
- 
getEnumprotected <E extends Enum<E>> E getEnum(Class<E> enumClass, FileSystemOptions fileSystemOptions, String name, E defaultValue) Gets a named option as an Enum.- Type Parameters:
- E- enumeration type
- Parameters:
- enumClass- class of enumeration type
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- 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:
 
- 
getFloatGets a named option as a Float.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- 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:
 
- 
getFloatGets a named option as a Float.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- 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:
 
- 
getFloatGets a named option as a Float.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- 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
 
- 
getIntegerGets a named option as an Integer.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- 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:
 
- 
getIntegerGets a named option as an Integer.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- 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:
 
- 
getIntegerprotected Integer getInteger(FileSystemOptions fileSystemOptions, String name, Integer defaultValue) Gets a named option as an Integer.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- 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
 
- 
getLongGets a named option as a Long.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- 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:
 
- 
getLongGets a named option as a Long.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- 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:
 
- 
getLongGets a named option as a Long.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- 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
 
- 
getParamGets a named parameter.- Type Parameters:
- T- The expected return type.
- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- get option with this name
- Returns:
- the named option or null
- Since:
- 1.0
 
- 
getParamOrDefaultGets a named parameter.- Type Parameters:
- T- The expected return type.
- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- get option with this name
- defaultValue- The default value if absent.
- Returns:
- the named option or defaultValue.
- Since:
- 2.10.0
 
- 
getRootURIGets the root URI of the file system.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- Returns:
- The root URI, or null.
- Since:
- 2.0
 
- 
getShortGets a named option as a Short.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- 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:
 
- 
getShortGets a named option as a Short.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- 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:
 
- 
getShortGets a named option as a Short.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- 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
 
- 
getStringGets a named option as a String.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- Returns:
- the option in optsor system properties, otherwise null
- Since:
- 2.0
- See Also:
 
- 
getStringGets a named option as a String.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option name
- defaultValue- value to return if option is not present
- Returns:
- the option in optsor system properties, otherwisedefaultValue
- Since:
- 2.0
 
- 
hasObjectChecks the named setting specified.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the option to check in- optsor system properties
- Returns:
- true if option exists
- Since:
- 2.0
 
- 
hasParamChecks if option exists.- Parameters:
- fileSystemOptions- file system options to query, may be null.
- name- the name to look up in- opts
- Returns:
- true if opts have the named parameter
- Since:
- 1.0
 
- 
setParamSets the named parameter.- Parameters:
- fileSystemOptions- the file system options to modify
- name- set option with this name
- value- boolean value to set
- Since:
- 2.1
 
- 
setParamSets the named parameter.- Parameters:
- fileSystemOptions- the file system options to modify
- name- set option with this name
- value- object value to set
- Since:
- 1.0
 
- 
setRootURISets the root URI of the file system.- Parameters:
- fileSystemOptions- the file system options to modify
- rootURI- The creator name to be associated with the file.
- Since:
- 2.0
 
- 
toBooleanObjectConverts the given primitive boolean to a Boolean object.- Parameters:
- value- a primitive boolean.
- Returns:
- the given primitive boolean as Boolean object.
- Since:
- 2.7.0
 
 
-