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

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

Introduction

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

Prototype

public void setLocations(Resource... locations) 

Source Link

Document

Set locations of properties files to be loaded.

Usage

From source file:fr.treeptik.cloudunit.initializer.CloudUnitApplicationContext.java

@Bean
@Profile("integration")
public static PropertySourcesPlaceholderConfigurer propertiesForIntegration() throws Exception {
    PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
    Resource[] resources = new Resource[] { new ClassPathResource("application-integration.properties") };
    pspc.setLocations(resources);
    pspc.setIgnoreUnresolvablePlaceholders(true);
    pspc.setLocalOverride(true);/*from   w w w.  j  a va2s .  c  om*/
    return pspc;
}

From source file:cn.org.once.cstack.initializer.CloudUnitApplicationContext.java

@Bean
@Profile("vagrant")
public static PropertySourcesPlaceholderConfigurer properties() throws Exception {
    String file = "application-vagrant.properties";
    PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
    pspc.setLocations(getResources(file));
    pspc.setIgnoreUnresolvablePlaceholders(true);
    pspc.setLocalOverride(true);//from   ww  w.  jav  a  2 s.  co m
    return pspc;
}

From source file:cn.org.once.cstack.initializer.CloudUnitApplicationContext.java

@Bean
@Profile("production")
public static PropertySourcesPlaceholderConfigurer propertiesForProduction() throws Exception {
    String file = "application-production.properties";
    PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
    pspc.setLocations(getResources(file));
    pspc.setIgnoreUnresolvablePlaceholders(true);
    pspc.setLocalOverride(true);/*from w ww . j a  va  2s . c  o m*/
    return pspc;
}

From source file:cn.org.once.cstack.initializer.CloudUnitApplicationContext.java

@Bean
@Profile("vagrant-demo")
public static PropertySourcesPlaceholderConfigurer propertiesForDemo() throws Exception {
    String file = "application-vagrant-demo.properties";
    PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
    pspc.setLocations(getResources(file));
    pspc.setIgnoreUnresolvablePlaceholders(true);
    pspc.setLocalOverride(true);//from   w w w. j a  va  2 s.c  o  m
    return pspc;
}

From source file:cn.org.once.cstack.initializer.CloudUnitApplicationContext.java

@Bean
@Profile("integration")
public static PropertySourcesPlaceholderConfigurer propertiesForIntegration() throws Exception {
    String file = "application-integration-local.properties";

    String envIntegration = System.getenv("CLOUDUNIT_JENKINS_CI");
    if ("true".equalsIgnoreCase(envIntegration)) {
        file = "application-integration.properties";
    }//from ww  w .  jav a  2s  .c o m

    PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
    pspc.setLocations(getResources(file));
    pspc.setIgnoreUnresolvablePlaceholders(true);
    pspc.setLocalOverride(true);
    return pspc;
}

From source file:dk.nsi.haiba.minipasconverter.config.MinipasConverterConfiguration.java

@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
    PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
    propertySourcesPlaceholderConfigurer.setIgnoreResourceNotFound(true);
    propertySourcesPlaceholderConfigurer.setIgnoreUnresolvablePlaceholders(false);

    propertySourcesPlaceholderConfigurer
            .setLocations(new Resource[] { new ClassPathResource("default-config.properties"),
                    new ClassPathResource("minipasconfig.properties") });

    return propertySourcesPlaceholderConfigurer;
}

From source file:cn.org.once.cstack.initializer.CloudUnitApplicationContext.java

@Bean
@Profile("test")//from  w  ww  . j a  v  a  2s . c  o  m
public static PropertySourcesPlaceholderConfigurer propertiesForTest() throws Exception {
    PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
    Resource[] resources = new Resource[] { new ClassPathResource("application-test.properties") };
    pspc.setLocations(resources);
    pspc.setIgnoreUnresolvablePlaceholders(true);
    pspc.setLocalOverride(true);
    return pspc;
}

From source file:dk.nsi.haiba.epimibaimporter.config.EPIMIBAConfiguration.java

@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
    PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
    propertySourcesPlaceholderConfigurer.setIgnoreResourceNotFound(true);
    propertySourcesPlaceholderConfigurer.setIgnoreUnresolvablePlaceholders(false);

    propertySourcesPlaceholderConfigurer
            .setLocations(new Resource[] { new ClassPathResource("default-config.properties"),
                    new ClassPathResource("epimibaconfig.properties") });

    return propertySourcesPlaceholderConfigurer;
}

From source file:de.thm.arsnova.config.SecurityConfig.java

@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
    final PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
    configurer.setLocations(new Resource[] { new ClassPathResource("arsnova.properties.example"),
            new FileSystemResource("file:///etc/arsnova/arsnova.properties"), });
    configurer.setIgnoreResourceNotFound(true);
    configurer.setIgnoreUnresolvablePlaceholders(false);

    return configurer;
}

From source file:dk.nsi.haiba.lprimporter.config.LPRConfiguration.java

@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
    PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
    propertySourcesPlaceholderConfigurer.setIgnoreResourceNotFound(true);
    propertySourcesPlaceholderConfigurer.setIgnoreUnresolvablePlaceholders(false);

    propertySourcesPlaceholderConfigurer
            .setLocations(new Resource[] { new ClassPathResource("default-config.properties"),
                    new ClassPathResource("lprconfig.properties") });

    return propertySourcesPlaceholderConfigurer;
}