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 application context I will need to access this environment variable to create the FileSystemResource bean. Here is an example of what I would normally have:
<bean id="properties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<bean class="org.springframework.core.io.FileSystemResource">
<constructor-arg>
<value>myprops.properties</value>
</constructor-arg>
</bean>
</property>
</bean>
Instead I will need to have it be something like
<value>${prop_file_location}/myprops.properties</value>
Where prop file location is an environment variable. Does anyone know an easy way of doing this?
I am using spring 2.5.6 and java 1.6