Gracefully handle partial prefs file at startup
Brought to you by:
mguessan
Currently, if no prefs file is found, all defaults are used. In the case of a partial prefs file, no defaults are used and those missing prefs are left blank. This should be changed so that any missing values are defaulted.
Usecase: I want to automate setup using a script, and I only need to change a few prefs from default. I could create a partial prefs file with only those non-default settings, run davmail, and all other non-specified prefs would fall back to defaults.
This could be accomplished by loading all defaults first, then reading the prefs file and replacing any prefs with values found. I don't see any downside to this approach, since the way it works now (blank values) is never useful.
Some settings have a default value, however others don't.
In your case another approach would be to use the example davmail.properties and script individual property change, e.g. with ant: