Can I use an Environment variable based location for Spring FileSystemResource?

前端 未结 5 599
清歌不尽
清歌不尽 2020-12-01 05:45

I have a requirement to have all our properties files be stored in a directory. The location of this directory should be stored in a system environment variable. In my appli

5条回答
  •  北海茫月
    2020-12-01 06:43

    You could always extend the FileSystemResource (i.e. PropertiesFileResource) that would initialize itself by taking prepending the property file location system property to the file path.

提交回复
热议问题