I'm trying to set up environment-specific properties in a file, customized for each device running the code. I'd like to be able to nest some properties in others, for example:
browser=chrome
baseUrl=${server}/app/login.do
server=http://localhost
I'd like to be able to get http://localhost/app/login.do
when I get the baseUrl
property.
Does java.util.Properties
support this behavior? If not, is there another core class that does?
The answer is No. java.util.Properties operates on Strings only.
Each key and its corresponding value in the property list is a string. (From Javadoc)
Edit: No core Java class does that, as no core Java framework/class is designed to do such a thing. I like Typesafe's Config library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With