Example usage for org.springframework.context.support PropertySourcesPlaceholderConfigurer setIgnoreResourceNotFound

List of usage examples for org.springframework.context.support PropertySourcesPlaceholderConfigurer setIgnoreResourceNotFound

Introduction

In this page you can find the example usage for org.springframework.context.support PropertySourcesPlaceholderConfigurer setIgnoreResourceNotFound.

Prototype

public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound) 

Source Link

Document

Set if failure to find the property resource should be ignored.

Usage

From source file:ru.elcor.mis.scheduler.config.AppConfig.java

@Bean
public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
    PropertySourcesPlaceholderConfigurer properties = new PropertySourcesPlaceholderConfigurer();
    Properties Props = new Properties();
    Props.setProperty("cron", "0-59/2 * * * * *");
    properties.setProperties(Props);//w  w  w .  j  ava 2 s  .com
    properties.setLocation(new ClassPathResource("scheduler.properties"));
    properties.setIgnoreResourceNotFound(false);

    return properties;
}

From source file:org.openhims.oauth2.configuration.PropertiesConfiguration.java

public PropertySourcesPlaceholderConfigurer getProperties() {
    PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
    Resource[] resources = new Resource[] { new ClassPathResource("properties/application.properties"),
            new ClassPathResource("properties/server.properties") };
    pspc.setLocations(resources);/*  www  . j  a v a2 s  .c o  m*/
    pspc.setIgnoreUnresolvablePlaceholders(IGNORE_UNRESOLVABLE_PLACEHOLDERS);
    pspc.setIgnoreResourceNotFound(true);
    return pspc;
}