public abstract class FileSystemConfigBuilder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
prefix
The prefix to use when resolving system properties
|
private static java.lang.String |
PREFIX
Default prefix to use when resolving system properties
|
private static java.lang.String |
ROOTURI
The root uri of the file system
|
| Modifier | Constructor and Description |
|---|---|
protected |
FileSystemConfigBuilder()
Constructs builder with default prefix.
|
protected |
FileSystemConfigBuilder(java.lang.String component)
Constructs builder with specified component name.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Boolean |
getBoolean(FileSystemOptions opts,
java.lang.String name)
Gets named option as boolean.
|
protected boolean |
getBoolean(FileSystemOptions opts,
java.lang.String name,
boolean defaultValue)
Gets named option as boolean.
|
protected java.lang.Boolean |
getBoolean(FileSystemOptions opts,
java.lang.String name,
java.lang.Boolean defaultValue)
Gets named option as boolean.
|
protected java.lang.Byte |
getByte(FileSystemOptions opts,
java.lang.String name)
Gets named option as byte.
|
protected byte |
getByte(FileSystemOptions opts,
java.lang.String name,
byte defaultValue)
Gets named option as byte.
|
protected java.lang.Byte |
getByte(FileSystemOptions opts,
java.lang.String name,
java.lang.Byte defaultValue)
Gets named option as byte.
|
protected java.lang.Character |
getCharacter(FileSystemOptions opts,
java.lang.String name)
Gets named option as character.
|
protected char |
getCharacter(FileSystemOptions opts,
java.lang.String name,
char defaultValue)
Gets named option as character.
|
protected java.lang.Character |
getCharacter(FileSystemOptions opts,
java.lang.String name,
java.lang.Character defaultValue)
Gets named option as character.
|
protected abstract java.lang.Class<? extends FileSystem> |
getConfigClass()
Gets the target of this configuration.
|
protected java.lang.Double |
getDouble(FileSystemOptions opts,
java.lang.String name)
Gets named option as double.
|
protected double |
getDouble(FileSystemOptions opts,
java.lang.String name,
double defaultValue)
Gets named option as double.
|
protected java.lang.Double |
getDouble(FileSystemOptions opts,
java.lang.String name,
java.lang.Double defaultValue)
Gets named option as double.
|
protected <E extends java.lang.Enum<E>> |
getEnum(java.lang.Class<E> enumClass,
FileSystemOptions opts,
java.lang.String name)
Gets named option as enumeration.
|
protected <E extends java.lang.Enum<E>> |
getEnum(java.lang.Class<E> enumClass,
FileSystemOptions opts,
java.lang.String name,
E defaultValue)
Gets named option as enumeration.
|
protected java.lang.Float |
getFloat(FileSystemOptions opts,
java.lang.String name)
Gets named option as float.
|
protected float |
getFloat(FileSystemOptions opts,
java.lang.String name,
float defaultValue)
Gets named option as float.
|
protected java.lang.Float |
getFloat(FileSystemOptions opts,
java.lang.String name,
java.lang.Float defaultValue)
Gets named option as float.
|
protected java.lang.Integer |
getInteger(FileSystemOptions opts,
java.lang.String name)
Gets named option as integer.
|
protected int |
getInteger(FileSystemOptions opts,
java.lang.String name,
int defaultValue)
Gets named option as integer.
|
protected java.lang.Integer |
getInteger(FileSystemOptions opts,
java.lang.String name,
java.lang.Integer defaultValue)
Gets named option as integer.
|
protected java.lang.Long |
getLong(FileSystemOptions opts,
java.lang.String name)
Gets named option as long.
|
protected long |
getLong(FileSystemOptions opts,
java.lang.String name,
long defaultValue)
Gets named option as long.
|
protected java.lang.Long |
getLong(FileSystemOptions opts,
java.lang.String name,
java.lang.Long defaultValue)
Gets named option as long.
|
protected java.lang.Object |
getParam(FileSystemOptions opts,
java.lang.String name)
Gets named parameter.
|
private java.lang.String |
getProperty(java.lang.String name)
Gets the system property for the given name.
|
java.lang.String |
getRootURI(FileSystemOptions opts)
Gets the root URI of the file system.
|
protected java.lang.Short |
getShort(FileSystemOptions opts,
java.lang.String name)
Gets named option as short.
|
protected short |
getShort(FileSystemOptions opts,
java.lang.String name,
short defaultValue)
Gets named option as short.
|
protected java.lang.Short |
getShort(FileSystemOptions opts,
java.lang.String name,
java.lang.Short defaultValue)
Gets named option as short.
|
protected java.lang.String |
getString(FileSystemOptions opts,
java.lang.String name)
Gets named option as String.
|
protected java.lang.String |
getString(FileSystemOptions opts,
java.lang.String name,
java.lang.String defaultValue)
Gets named option as String.
|
protected boolean |
hasObject(FileSystemOptions opts,
java.lang.String name)
Checks the named setting specified.
|
protected boolean |
hasParam(FileSystemOptions opts,
java.lang.String name)
Checks if option exists.
|
protected void |
setParam(FileSystemOptions opts,
java.lang.String name,
boolean value)
Sets named parameter.
|
protected void |
setParam(FileSystemOptions opts,
java.lang.String name,
java.lang.Object value)
Sets named parameter.
|
void |
setRootURI(FileSystemOptions opts,
java.lang.String rootURI)
Sets the root URI of the file system.
|
private java.lang.String |
toPropertyKey(java.lang.String name)
Converts the given name into a System property key.
|
private static final java.lang.String PREFIX
private static final java.lang.String ROOTURI
private final java.lang.String prefix
protected FileSystemConfigBuilder()
protected FileSystemConfigBuilder(java.lang.String component)
component - component name to be used in prefixpublic void setRootURI(FileSystemOptions opts, java.lang.String rootURI)
opts - the file system options to modifyrootURI - The creator name to be associated with the file.public java.lang.String getRootURI(FileSystemOptions opts)
opts - file system options to work withprotected void setParam(FileSystemOptions opts, java.lang.String name, boolean value)
opts - the file system options to modifyname - set option with this namevalue - boolean value to setprotected void setParam(FileSystemOptions opts, java.lang.String name, java.lang.Object value)
opts - the file system options to modifyname - set option with this namevalue - object value to setprotected java.lang.Object getParam(FileSystemOptions opts, java.lang.String name)
opts - file system options to work withname - get option with this nameprotected boolean hasParam(FileSystemOptions opts, java.lang.String name)
opts - file system options to work withname - the name to look up in optsprotected boolean hasObject(FileSystemOptions opts, java.lang.String name)
opts - file system options to work withname - the option to check in opts or system propertiesprotected java.lang.Boolean getBoolean(FileSystemOptions opts, java.lang.String name)
opts - file system options to work withname - the option nameopts or system properties, otherwise nullgetBoolean(FileSystemOptions, String, Boolean)protected boolean getBoolean(FileSystemOptions opts, java.lang.String name, boolean defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuegetBoolean(FileSystemOptions, String, Boolean)protected java.lang.Boolean getBoolean(FileSystemOptions opts, java.lang.String name, java.lang.Boolean defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuegetBoolean(FileSystemOptions, String, Boolean)protected java.lang.Byte getByte(FileSystemOptions opts, java.lang.String name)
opts - file system options to work withname - the option nameopts or system properties, otherwise nullgetByte(FileSystemOptions, String, Byte)protected byte getByte(FileSystemOptions opts, java.lang.String name, byte defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuegetByte(FileSystemOptions, String, Byte)protected java.lang.Byte getByte(FileSystemOptions opts, java.lang.String name, java.lang.Byte defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValueprotected java.lang.Character getCharacter(FileSystemOptions opts, java.lang.String name)
opts - file system options to work withname - the option nameopts or system properties, otherwise nullgetCharacter(FileSystemOptions, String, Character)protected char getCharacter(FileSystemOptions opts, java.lang.String name, char defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuegetCharacter(FileSystemOptions, String, Character)protected java.lang.Character getCharacter(FileSystemOptions opts, java.lang.String name, java.lang.Character defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValueprotected java.lang.Double getDouble(FileSystemOptions opts, java.lang.String name)
opts - file system options to work withname - the option nameopts or system properties, otherwise nullgetDouble(FileSystemOptions, String, Double)protected double getDouble(FileSystemOptions opts, java.lang.String name, double defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuegetDouble(FileSystemOptions, String, Double)protected java.lang.Double getDouble(FileSystemOptions opts, java.lang.String name, java.lang.Double defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValueprotected <E extends java.lang.Enum<E>> E getEnum(java.lang.Class<E> enumClass,
FileSystemOptions opts,
java.lang.String name)
E - enumeration typeenumClass - class of enumeration typeopts - file system options to work withname - the option name *opts or system properties, otherwise nulljava.lang.IllegalArgumentException - if option value is not a known enumeration.getEnum(Class, FileSystemOptions, String, Enum)protected <E extends java.lang.Enum<E>> E getEnum(java.lang.Class<E> enumClass,
FileSystemOptions opts,
java.lang.String name,
E defaultValue)
E - enumeration typeenumClass - class of enumeration typeopts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuejava.lang.IllegalArgumentException - if option value is not a known enumeration.getEnum(Class, FileSystemOptions, String, Enum)protected java.lang.Float getFloat(FileSystemOptions opts, java.lang.String name)
opts - file system options to work withname - the option nameopts or system properties, otherwise nulljava.lang.NumberFormatException - if option value is not a valid float.getFloat(FileSystemOptions, String, Float)protected float getFloat(FileSystemOptions opts, java.lang.String name, float defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuejava.lang.NumberFormatException - if option value is not a valid float.getFloat(FileSystemOptions, String, Float)protected java.lang.Float getFloat(FileSystemOptions opts, java.lang.String name, java.lang.Float defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuejava.lang.NumberFormatException - if option value is not a valid float.protected java.lang.Integer getInteger(FileSystemOptions opts, java.lang.String name)
opts - file system options to work withname - the option nameopts or system properties, otherwise nulljava.lang.NumberFormatException - if option value is not a valid integer.getInteger(FileSystemOptions, String, Integer)protected int getInteger(FileSystemOptions opts, java.lang.String name, int defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuejava.lang.NumberFormatException - if option value is not a valid integer.getInteger(FileSystemOptions, String, Integer)protected java.lang.Integer getInteger(FileSystemOptions opts, java.lang.String name, java.lang.Integer defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuejava.lang.NumberFormatException - if option value is not a valid integer.protected java.lang.Long getLong(FileSystemOptions opts, java.lang.String name)
opts - file system options to work withname - the option nameopts or system properties, otherwise nulljava.lang.NumberFormatException - if option value is not a valid long.getLong(FileSystemOptions, String, Long)protected long getLong(FileSystemOptions opts, java.lang.String name, long defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuejava.lang.NumberFormatException - if option value is not a valid long.getLong(FileSystemOptions, String, Long)protected java.lang.Long getLong(FileSystemOptions opts, java.lang.String name, java.lang.Long defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuejava.lang.NumberFormatException - if option value is not a valid long.protected java.lang.Short getShort(FileSystemOptions opts, java.lang.String name)
opts - file system options to work withname - the option nameopts or system properties, otherwise nulljava.lang.NumberFormatException - if option value is not a valid short.getShort(FileSystemOptions, String, Short)protected short getShort(FileSystemOptions opts, java.lang.String name, short defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuejava.lang.NumberFormatException - if option value is not a valid shortgetShort(FileSystemOptions, String, Short)protected java.lang.Short getShort(FileSystemOptions opts, java.lang.String name, java.lang.Short defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValuejava.lang.NumberFormatException - if option value is not a valid shortprotected java.lang.String getString(FileSystemOptions opts, java.lang.String name)
opts - file system options to work withname - the option nameopts or system properties, otherwise nullgetString(FileSystemOptions, String, String)protected java.lang.String getString(FileSystemOptions opts, java.lang.String name, java.lang.String defaultValue)
opts - file system options to work withname - the option namedefaultValue - value to return if option is not presentopts or system properties, otherwise defaultValueprotected abstract java.lang.Class<? extends FileSystem> getConfigClass()
private java.lang.String toPropertyKey(java.lang.String name)
name - a name to combine with the builder prefixprivate java.lang.String getProperty(java.lang.String name)
name - The name to lookup combined with the prefix.