Type: New Feature
Affects Version/s: None
Fix Version/s: 2.6
The properties file format in Commons Configuration allows for a properties file to load external properties files through a special key called "include". This PR allows for a call site to customize what happens when an included file does not exist or is in error.
The main change is to re-implement the current behavior for include error handing through a new consumer used in PropertiesConfiguration by introducing a functional interface to consume any type and throw ConfigurationException:
The above is the common pattern when you need a consumer to throw a checked exception.
The PropertiesConfiguration default behavior does not change and is implemented as:
In addition, a noop implementation is provided for simple use cases and tests:
You can set an include listener through new methods in PropertiesConfiguration and through the fluent API as well. See the PR for details.
Note that this PR does not address detecting cyclical include files but does include a new test method which is decorated with @Ignore.