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 Summary
Modifier and TypeMethodDescriptiondefault BLoads a properties file from the file directly or (if not found) from first folder containing such a file as of the specification for the methodConfigLocator.getFolders().withFile(File aFile, ConfigLocator aConfigLocator) 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 methodConfigLocator.getFolders().withInputStream(InputStream aInputStream) Reads the properties from the givenInputStream.default BwithResourceFilePath(Class<?> aResourceClass, String aFilePath) 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 methodConfigLocator.getFolders().withResourceFilePath(Class<?> aResourceClass, String aFilePath, ConfigLocator aConfigLocator) 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 methodConfigLocator.getFolders().default BwithResourceFilePath(String aFilePath) 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 methodConfigLocator.getFolders().default BwithResourceFilePath(String aFilePath, ConfigLocator aConfigLocator) 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 methodConfigLocator.getFolders().Loads the properties from the givenURL.
-
Method Details
-
withFile
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 methodConfigLocator.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
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 methodConfigLocator.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 methodConfigLocator.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 methodConfigLocator.getFolders().- Parameters:
aFilePath- The file of the properties file to load.aConfigLocator- TheConfigLocatorspecifying 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 methodConfigLocator.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- TheConfigLocatorspecifying 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
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 methodConfigLocator.getFolders().- Parameters:
aFile- The file of the properties to load.aConfigLocator- TheConfigLocatorspecifying 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
Reads the properties from the givenInputStream.- Parameters:
aInputStream- TheInputStreamfrom 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
Loads the properties from the givenURL.- Parameters:
aUrl- TheURLfrom 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.
-