A
Andy Fish
Hi,
My app uses a property file for configuration, and I would like to have some
way to substitute other properties (or maybe even environment variables)
when interpreting the properties file. It's probably best illustrated by an
example, instead of:
myapp.logfile = /usr/local/myapp/logs/logfile
myapp.archivedir = /usr/local/myapp/data/archived
we could have something like:
myapp.log.file = ${myapp.installroot}/logs/logfile
myapp.log.file = ${myapp.installroot}/data/archived
This means that I can supply them with a default properties file that will
work wherever they install the application.
Anyone know of a standard way of doing this? I'm sure it would be fairly
easy to subclass java.lang.properties but I don't want to reinvent the
wheel.
Andy
My app uses a property file for configuration, and I would like to have some
way to substitute other properties (or maybe even environment variables)
when interpreting the properties file. It's probably best illustrated by an
example, instead of:
myapp.logfile = /usr/local/myapp/logs/logfile
myapp.archivedir = /usr/local/myapp/data/archived
we could have something like:
myapp.log.file = ${myapp.installroot}/logs/logfile
myapp.log.file = ${myapp.installroot}/data/archived
This means that I can supply them with a default properties file that will
work wherever they install the application.
Anyone know of a standard way of doing this? I'm sure it would be fairly
easy to subclass java.lang.properties but I don't want to reinvent the
wheel.
Andy