Class ApplicationPropertiesSource
java.lang.Object
io.fluxcapacitor.common.application.JavaPropertiesSource
io.fluxcapacitor.common.application.ApplicationPropertiesSource
- All Implemented Interfaces:
PropertySource
A Example
PropertySource
implementation that loads properties from an application.properties
file located on
the classpath.
This is a conventional source for static configuration values such as credentials, service endpoints, or application
settings. The file is expected to be in the root of the classpath (e.g., inside resources/
).
Example application.properties
:
service.url=https://api.example.com retry.count=3
The loaded properties are backed by a Properties
instance and exposed via the
JavaPropertiesSource.get(String)
method.
This class uses FileUtils.loadProperties(String)
which supports merging multiple files with the
same name from the classpath and logs duplicate key warnings.
- See Also:
-
Field Summary
Fields inherited from interface io.fluxcapacitor.common.application.PropertySource
substitutionPattern
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newApplicationPropertiesSource
by loading theapplication.properties
file from the classpath. -
Method Summary
Methods inherited from class io.fluxcapacitor.common.application.JavaPropertiesSource
get
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.fluxcapacitor.common.application.PropertySource
andThen, containsProperty, get, getBoolean, getBoolean, require, substituteProperties
-
Constructor Details
-
ApplicationPropertiesSource
public ApplicationPropertiesSource()Constructs a newApplicationPropertiesSource
by loading theapplication.properties
file from the classpath.
-