Class FileSystemConfigBuilder

java.lang.Object
org.apache.commons.vfs2.FileSystemConfigBuilder
Direct Known Subclasses:
DefaultFileSystemConfigBuilder, FtpFileSystemConfigBuilder, HttpFileSystemConfigBuilder, RamFileSystemConfigBuilder, ResourceFileSystemConfigBuilder, SftpFileSystemConfigBuilder

public abstract class FileSystemConfigBuilder extends Object
Abstract class which has the right to fill FileSystemOptions.
  • Constructor Details

    • FileSystemConfigBuilder

      Construct builder with default prefix.
      Since:
      1.0
    • FileSystemConfigBuilder

      protected FileSystemConfigBuilder(String component)
      Construct builder with specified component name.
      Parameters:
      component - component name to be used in prefix
      Since:
      2.0
  • Method Details

    • setRootURI

      public void setRootURI(FileSystemOptions opts, String rootURI)
      The root URI of the file system.
      Parameters:
      opts - the file system options to modify
      rootURI - 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

      protected void setParam(FileSystemOptions opts, String name, boolean value)
      Set named parameter.
      Parameters:
      opts - the file system options to modify
      name - set option with this name
      value - boolean value to set
      Since:
      2.1
    • setParam

      protected void setParam(FileSystemOptions opts, String name, Object value)
      Set named parameter.
      Parameters:
      opts - the file system options to modify
      name - set option with this name
      value - object value to set
      Since:
      1.0
    • getParam

      protected Object getParam(FileSystemOptions opts, String name)
      Get named parameter.
      Parameters:
      opts - file system options to work with
      name - get option with this name
      Returns:
      the named option or null
      Since:
      1.0
    • hasParam

      protected boolean hasParam(FileSystemOptions opts, String name)
      Check if option exists.
      Parameters:
      opts - file system options to work with
      name - the name to look up in opts
      Returns:
      true if opts have the named parameter
      Since:
      1.0
    • hasObject

      protected boolean hasObject(FileSystemOptions opts, String name)
      Is named setting specified.
      Parameters:
      opts - file system options to work with
      name - the option to check in opts or system properties
      Returns:
      true if option exists
      Since:
      2.0
    • getBoolean

      protected Boolean getBoolean(FileSystemOptions opts, String name)
      Get named option as boolean.
      Parameters:
      opts - file system options to work with
      name - the option name
      Returns:
      the option in opts or system properties, otherwise null
      Since:
      2.0
      See Also:
    • getBoolean

      protected boolean getBoolean(FileSystemOptions opts, String name, boolean defaultValue)
      Get named option as boolean.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Since:
      2.0
      See Also:
    • getBoolean

      protected Boolean getBoolean(FileSystemOptions opts, String name, Boolean defaultValue)
      Get named option as boolean.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Since:
      2.0
      See Also:
    • getByte

      protected Byte getByte(FileSystemOptions opts, String name)
      Get named option as byte.
      Parameters:
      opts - file system options to work with
      name - the option name
      Returns:
      the option in opts or system properties, otherwise null
      Since:
      2.0
      See Also:
    • getByte

      protected byte getByte(FileSystemOptions opts, String name, byte defaultValue)
      Get named option as byte.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Since:
      2.0
      See Also:
    • getByte

      protected Byte getByte(FileSystemOptions opts, String name, Byte defaultValue)
      Get named option as byte.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Since:
      2.0
    • getCharacter

      Get named option as character.
      Parameters:
      opts - file system options to work with
      name - the option name
      Returns:
      the option in opts or system properties, otherwise null
      Since:
      2.0
      See Also:
    • getCharacter

      protected char getCharacter(FileSystemOptions opts, String name, char defaultValue)
      Get named option as character.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Since:
      2.0
      See Also:
    • getCharacter

      protected Character getCharacter(FileSystemOptions opts, String name, Character defaultValue)
      Get named option as character.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Since:
      2.0
    • getDouble

      protected Double getDouble(FileSystemOptions opts, String name)
      Get named option as double.
      Parameters:
      opts - file system options to work with
      name - the option name
      Returns:
      the option in opts or system properties, otherwise null
      Since:
      2.0
      See Also:
    • getDouble

      protected double getDouble(FileSystemOptions opts, String name, double defaultValue)
      Get named option as double.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Since:
      2.0
      See Also:
    • getDouble

      protected Double getDouble(FileSystemOptions opts, String name, Double defaultValue)
      Get named option as double.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Since:
      2.0
    • getEnum

      protected <E extends Enum<E>> E getEnum(Class<E> enumClass, FileSystemOptions opts, String name)
      Get named option as enumeration.
      Type Parameters:
      E - enumeration type
      Parameters:
      enumClass - class of enumeration type
      opts - file system options to work with
      name - 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 type
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Throws:
      IllegalArgumentException - if option value is not a known enumeration.
      Since:
      2.1
      See Also:
    • getFloat

      protected Float getFloat(FileSystemOptions opts, String name)
      Get named option as float.
      Parameters:
      opts - file system options to work with
      name - 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

      protected float getFloat(FileSystemOptions opts, String name, float defaultValue)
      Get named option as float.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Throws:
      NumberFormatException - if option value is not a valid float.
      Since:
      2.0
      See Also:
    • getFloat

      protected Float getFloat(FileSystemOptions opts, String name, Float defaultValue)
      Get named option as float.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Throws:
      NumberFormatException - if option value is not a valid float.
      Since:
      2.0
    • getInteger

      protected Integer getInteger(FileSystemOptions opts, String name)
      Get named option as integer.
      Parameters:
      opts - file system options to work with
      name - 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

      protected int getInteger(FileSystemOptions opts, String name, int defaultValue)
      Get named option as integer.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Throws:
      NumberFormatException - if option value is not a valid integer.
      Since:
      2.0
      See Also:
    • getInteger

      protected Integer getInteger(FileSystemOptions opts, String name, Integer defaultValue)
      Get named option as integer.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Throws:
      NumberFormatException - if option value is not a valid integer.
      Since:
      2.0
    • getLong

      protected Long getLong(FileSystemOptions opts, String name)
      Get named option as long.
      Parameters:
      opts - file system options to work with
      name - 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

      protected long getLong(FileSystemOptions opts, String name, long defaultValue)
      Get named option as long.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Throws:
      NumberFormatException - if option value is not a valid long.
      Since:
      2.0
      See Also:
    • getLong

      protected Long getLong(FileSystemOptions opts, String name, Long defaultValue)
      Get named option as long.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Throws:
      NumberFormatException - if option value is not a valid long.
      Since:
      2.0
    • getShort

      protected Short getShort(FileSystemOptions opts, String name)
      Get named option as short.
      Parameters:
      opts - file system options to work with
      name - 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

      protected short getShort(FileSystemOptions opts, String name, short defaultValue)
      Get named option as short.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Throws:
      NumberFormatException - if option value is not a valid short
      Since:
      2.0
      See Also:
    • getShort

      protected Short getShort(FileSystemOptions opts, String name, Short defaultValue)
      Get named option as short.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Throws:
      NumberFormatException - if option value is not a valid short
      Since:
      2.0
    • getString

      protected String getString(FileSystemOptions opts, String name)
      Get named option as String.
      Parameters:
      opts - file system options to work with
      name - the option name
      Returns:
      the option in opts or system properties, otherwise null
      Since:
      2.0
      See Also:
    • getString

      protected String getString(FileSystemOptions opts, String name, String defaultValue)
      Get named option as String.
      Parameters:
      opts - file system options to work with
      name - the option name
      defaultValue - value to return if option is not present
      Returns:
      the option in opts or system properties, otherwise defaultValue
      Since:
      2.0
    • getConfigClass

      protected abstract Class<? extends FileSystem> getConfigClass()
      Get the target of this configuration.
      Returns:
      the specific file system class
      Since:
      1.0