0
我試圖使用PropertiesFactoryBean從特定目錄加載以.prop
結尾的所有文件。Spring PropertiesFactoryBean通配符擴展不起作用
<bean id="props" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="location" value="file:/etc/app/*.prop"/>
</bean>
運行此作爲JUnit測試,everyting工作的所有文件確定,org.springframework.core.io.support.PropertiesLoaderSupport#loadProperties
獲取列表(通配符展開)爲FileSystemResource
並加載它們。
但是,當在OSGI環境(卡拉夫)PropertiesLoaderSupport#loadProperties
運行將獲得單一的OsgiBundleResource
與路徑設置爲/etc/app/*.prop
,當然這是無效的。