Interface ResourceConfigurable<B extends ResourceConfigurable<B>>

Type Parameters:
B - The generic type of the builder return type.

public interface ResourceConfigurable<B extends ResourceConfigurable<B>>
The ResourceConfigurable interface provides builder additions for configuring the source of a properties origin with e.g. "dynamic" ImmutableResourceProperties: As ImmutableResourceProperties are immutable from an interface's point of view, there are no mutating methods provided. Sub-types of the or additions to the ImmutableResourceProperties might need to load the properties after instantiation. Such types implement this interface, providing means to load from resources after instantiation.

Note: This interface exists independent of the ResourceProperties and ImmutableResourceProperties types which do not implement this interface directly and have similar methods not directly related to the methods defined by this interface.

  • Method Details

    • withFile

      default B withFile(File aFile) throws IOException, ParseException
      Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification for the method ConfigLocator.getFolders().
      Parameters:
      aFile - The file of the properties to load.
      Returns:
      This instance as of the builder pattern for chained method calls.
      Throws:
      IOException - thrown in case accessing or processing the properties file failed.
      ParseException - Signals that an error has been reached unexpectedly while parsing the data to be loaded.
    • withResourceFilePath

      default B withResourceFilePath(String aFilePath) throws IOException, ParseException
      Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification for the method ConfigLocator.getFolders().
      Parameters:
      aFilePath - The file of the properties file to load.
      Returns:
      This instance as of the builder pattern for chained method calls.
      Throws:
      IOException - thrown in case accessing or processing the properties file failed.
      ParseException - Signals that an error has been reached unexpectedly while parsing the data to be loaded.
    • withResourceFilePath

      default B withResourceFilePath(Class<?> aResourceClass, String aFilePath) throws IOException, ParseException
      Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification for the method ConfigLocator.getFolders().
      Parameters:
      aResourceClass - The class which's class loader is to take care of loading the properties (from inside a JAR).
      aFilePath - The file of the properties file to load.
      Returns:
      This instance as of the builder pattern for chained method calls.
      Throws:
      IOException - thrown in case accessing or processing the properties file failed.
      ParseException - Signals that an error has been reached unexpectedly while parsing the data to be loaded.
    • withResourceFilePath

      default B withResourceFilePath(String aFilePath, ConfigLocator aConfigLocator) throws IOException, ParseException
      Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification for the method ConfigLocator.getFolders().
      Parameters:
      aFilePath - The file of the properties file to load.
      aConfigLocator - The ConfigLocator specifying where to seek for properties.
      Returns:
      This instance as of the builder pattern for chained method calls.
      Throws:
      IOException - thrown in case accessing or processing the properties file failed.
      ParseException - Signals that an error has been reached unexpectedly while parsing the data to be loaded.
    • withResourceFilePath

      B withResourceFilePath(Class<?> aResourceClass, String aFilePath, ConfigLocator aConfigLocator) throws IOException, ParseException
      Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification for the method ConfigLocator.getFolders().
      Parameters:
      aResourceClass - The class which's class loader is to take care of loading the properties (from inside a JAR).
      aFilePath - The file of the properties file to load.
      aConfigLocator - The ConfigLocator specifying where to seek for properties.
      Returns:
      This instance as of the builder pattern for chained method calls.
      Throws:
      IOException - thrown in case accessing or processing the properties file failed.
      ParseException - Signals that an error has been reached unexpectedly while parsing the data to be loaded.
    • withFile

      B withFile(File aFile, ConfigLocator aConfigLocator) throws IOException, ParseException
      Loads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification for the method ConfigLocator.getFolders().
      Parameters:
      aFile - The file of the properties to load.
      aConfigLocator - The ConfigLocator specifying where to seek for properties.
      Returns:
      This instance as of the builder pattern for chained method calls.
      Throws:
      IOException - thrown in case accessing or processing the properties file failed.
      ParseException - Signals that an error has been reached unexpectedly while parsing the data to be loaded.
    • withInputStream

      B withInputStream(InputStream aInputStream) throws IOException, ParseException
      Reads the properties from the given InputStream.
      Parameters:
      aInputStream - The InputStream from which to read the properties.
      Returns:
      This instance as of the builder pattern for chained method calls.
      Throws:
      IOException - thrown in case accessing or processing the properties file failed.
      ParseException - Signals that an error has been reached unexpectedly while parsing the data to be loaded.
    • withURL

      B withURL(URL aUrl) throws IOException, ParseException
      Loads the properties from the given URL.
      Parameters:
      aUrl - The URL from which to read the properties.
      Returns:
      This instance as of the builder pattern for chained method calls.
      Throws:
      IOException - thrown in case accessing or processing the properties file failed.
      ParseException - Signals that an error has been reached unexpectedly while parsing the data to be loaded.