Package org.springframework.boot.env

Examples of org.springframework.boot.env.PropertySourcesLoader


      this.resourceLoader = resourceLoader == null ? new DefaultResourceLoader()
          : resourceLoader;
    }

    public void load() throws IOException {
      this.propertiesLoader = new PropertySourcesLoader();
      this.profiles = Collections.asLifoQueue(new LinkedList<String>());
      this.activatedProfiles = false;
      if (this.environment.containsProperty(ACTIVE_PROFILES_PROPERTY)) {
        // Any pre-existing active profiles set via property sources (e.g. System
        // properties) take precedence over those added in config files.
View Full Code Here


  }

  private PropertySources loadPropertySources(String[] locations,
      boolean mergeDefaultSources) {
    try {
      PropertySourcesLoader loader = new PropertySourcesLoader();
      for (String location : locations) {
        Resource resource = this.resourceLoader.getResource(this.environment
            .resolvePlaceholders(location));
        String[] profiles = this.environment.getActiveProfiles();
        for (int i = profiles.length; i-- > 0;) {
          String profile = profiles[i];
          loader.load(resource, profile);
        }
        loader.load(resource);
      }

      MutablePropertySources loaded = loader.getPropertySources();
      if (mergeDefaultSources) {
        for (PropertySource<?> propertySource : this.propertySources) {
          loaded.addLast(propertySource);
        }
      }
View Full Code Here

TOP

Related Classes of org.springframework.boot.env.PropertySourcesLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.