Creating default user configuration files if missing in spring boot

60 Views Asked by At

How can I have spring create a default configuration file for the end user if it does not exist at the target location. I would like this configuration file to be mapped to a bean after it has been created. I've searched the internet for spring tutorials but I have been unable to find one that demonstrates this.

I would like to have a system that does the following:

  1. Scans for configuration beans
  2. Checks if the configuration file exists on the file system
  3. Writes configuration defaults to the file if it does not exist
  4. Maps the values to the configuration bean
0

There are 0 best solutions below