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

前端 未结 5 603
清歌不尽
清歌不尽 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:21

    In Spring.Net we have got the IVariableSource interface and PropertyPlaceholderConfigurer which are able to retrieve values from environment variables. Maybe there is something similar in the Spring Framework for Java?

    Edit: I think I found the corresponding java bean which is named PropertyPlaceholderConfigurer as well in the java docs.

提交回复
热议问题