0

I have a configuration (config.properties) something like

app.rootDir=
app.reportDir=${app.rootDir}/report

The app.rootDir is not a fixed parameter and it must be initialized by external module. I need keep the ${app.reportDir} keep dynamic reference to ${app.rootDir}. Use pseudo code to illustrate the problem:

// Init the root dir as '/usr/app'
config.setValue('app.rootDir','/usr/app');

// I need the reportDir to be '/usr/app/report'
String reportDir = config.getValue('app.reportDir'); 

I can write some codes to get this feature but I'd like to know if there is any existing library do this?

I can use properties, yaml, or json as configuration file type, according to the library availability.

duckegg
  • 1,379
  • 2
  • 13
  • 20

0 Answers0