本文整理汇总了Java中org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.setIgnoreResourceNotFound方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyPlaceholderConfigurer.setIgnoreResourceNotFound方法的具体用法?Java PropertyPlaceholderConfigurer.setIgnoreResourceNotFound怎么用?Java PropertyPlaceholderConfigurer.setIgnoreResourceNotFound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
的用法示例。
在下文中一共展示了PropertyPlaceholderConfigurer.setIgnoreResourceNotFound方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: propertyPlaceholderConfigurer
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
final PropertyPlaceholderConfigurer propConfig =
new PropertyPlaceholderConfigurer();
propConfig.setIgnoreResourceNotFound(true);
String sysPropPath = System.getProperty("app.cfg");
if (sysPropPath != null) {
propConfig.setLocation(new FileSystemResource(sysPropPath));
} else {
propConfig.setLocation(new ClassPathResource(APP_PROPERTIES));
}
return propConfig;
}
示例2: propertyConfig
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public PropertyPlaceholderConfigurer propertyConfig() {
PropertyPlaceholderConfigurer placeholderConfigurer = new PropertyPlaceholderConfigurer();
placeholderConfigurer.setLocation(new ClassPathResource("application-test.properties"));
placeholderConfigurer.setIgnoreResourceNotFound(true);
return placeholderConfigurer;
}
示例3: newApplicationConf
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
public static PropertyPlaceholderConfigurer newApplicationConf(boolean searchSystemEnvironment, String... locations){
Assert.notEmpty(locations);
PropertyPlaceholderConfigurer ppc = new JFishPropertyPlaceholder();
ppc.setIgnoreResourceNotFound(true);
ppc.setIgnoreUnresolvablePlaceholders(true);
ppc.setSearchSystemEnvironment(searchSystemEnvironment);
List<Resource> resources = new ArrayList<Resource>();
for(String path : locations){
resources.add(new ClassPathResource(path));
}
ppc.setLocations(resources.toArray(new Resource[resources.size()]));
return ppc;
}
示例4: propertyPlaceholderConfigurer
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
ppc.setIgnoreResourceNotFound(true);
final Properties properties = new Properties();
properties.setProperty("cf.resource", ApiControllerTest.CF_RESOURCE);
properties.setProperty("cf.cli.version", "");
properties.setProperty("cf.cli.url", "");
properties.setProperty("platform.version", "0.1");
properties.setProperty("platform.coreorg", "coreOrg");
ppc.setProperties(properties);
return ppc;
}
示例5: propertyPlaceholderConfigurer
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
ppc.setIgnoreResourceNotFound(true);
final Properties properties = new Properties();
properties.setProperty("demo.data", ResourceControllerTest.CF_RESOURCE);
ppc.setProperties(properties);
return ppc;
}
示例6: propertyPlaceholderConfigurer
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
/**
* Returns a general properties placeholder configurer based on
* {@link #logSnifferProperties()}.
*
* @param props
* autowired logSnifferProperties bean
* @return A general properties placeholder configurer.
* @throws IOException
*/
@Bean
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
@Autowired
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer(
@Qualifier(BEAN_LOGSNIFFER_PROPS) final Properties props) throws IOException {
final PropertyPlaceholderConfigurer c = new PropertyPlaceholderConfigurer();
c.setIgnoreResourceNotFound(true);
c.setIgnoreUnresolvablePlaceholders(true);
c.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE);
c.setProperties(props);
return c;
}