Fetch configuration at configurationPath.

@return Future of stream configuration
168071
@Override
    public CompletableFuture<StreamConfiguration> getConfiguration() {
        return getConfigurationData(false).thenApply(x -> x.getObject().getStreamConfiguration());
    }
788003
private static JCorsConfig loadFromFileStream(InputStream fileStream) {

		try {

			JAXBContext context = JAXBContext.newInstance(ConfigBuilder.class);
			
			Unmarshaller unmarshaller = context.createUnmarshaller();
			unmarshaller.setSchema(loadXmlSchema());

			ConfigBuilder configBuilder = (ConfigBuilder) unmarshaller.unmarshal(fileStream);
			Constraint.ensureNotNull(configBuilder, "It was not possible to get a valid configuration builder instance");

			return configBuilder.buildConfig();

		} catch (Exception e) {

			log.error("Failed loading configuration file", e);
			return null;
		}

	}
289613
Future<AggregatorConfiguration> getAggregationConfiguration() {
        return new HAConfFuture<>(invokeSubServiceConfUpdates(),
                new HAConfFuture.ConfResultSupplier<ConsolidatedResult<AggregatorConfiguration>>() {
                    public ConsolidatedResult<AggregatorConfiguration> get() {
                        return lastConsolidatedConfiguration;
                    }
                });
    }
867427
@Override
  public Configuration loadConfig() throws ConfigurationException, IOException {

    Configuration resultConfig = new Configuration();

    if (!Utils.localFileExists(this.getConfigFileName())) {
      // String configFileName = System.getenv(ConfigConstant.DDF_INI_ENV_VAR.getValue());
      File file = new File(this.locateConfigFileName(this.getConfigDir(), this.getConfigFileName()));
      mConfigDir = file.getParentFile().getName();
      mConfigFileName = file.getCanonicalPath();
    }

    if (!Utils.localFileExists(this.getConfigFileName())) return null;

    HierarchicalINIConfiguration config = new HierarchicalINIConfiguration(this.getConfigFileName());

    @SuppressWarnings("unchecked")
    Set<String> sectionNames = config.getSections();
    for (String sectionName : sectionNames) {
      SubnodeConfiguration section = config.getSection(sectionName);
      if (section != null) {
        Configuration.Section resultSection = resultConfig.getSection(sectionName);

        @SuppressWarnings("unchecked")
        Iterator<String> keys = section.getKeys();
        while (keys.hasNext()) {
          String key = keys.next();
          String value = section.getString(key);
          if (value != null) {
            resultSection.set(key, value);
          }
        }
      }
    }

    mConfig = resultConfig;
    return mConfig;
  }
1110798
public static String getConfigLocation() {
        if (configLocation == null) {
            String configLoc = System.getProperty(MDW_CONFIG_LOCATION);
            if (configLoc != null) {
                if (!configLoc.endsWith("/"))
                    configLoc = configLoc + "/";
                configLocation = configLoc;
                System.out.println("Loading configuration files from '" + new File(configLoc).getAbsolutePath() + "'");
            }
        }
        return configLocation;
    }
982345
@Override
  public <C extends Configuration<K, V>> C getConfiguration(Class<C> clazz) {
    throw new UnsupportedOperationException();
  }
1165451
@Override
    public Configuration getConfiguration() {
        try {
            globalLock.readLock().lock();
            return configuration;
        } finally {
            globalLock.readLock().unlock();
        }
    }
1354523
@Override
  public Config getOwnConfig(ConfigKeyPath configKey, String version) throws VersionDoesNotExistException {
    Preconditions.checkNotNull(configKey, "configKey cannot be null!");
    Preconditions.checkArgument(version.equals(getCurrentVersion()));

    Path datasetDir = getDatasetDirForKey(configKey);
    Path mainConfFile = this.fs.getPath(datasetDir.toString(), SimpleHadoopFilesystemConfigStore.MAIN_CONF_FILE_NAME);

    try {
      if (!Files.exists(mainConfFile)) {
        return ConfigFactory.empty();
      }

      if (!Files.isDirectory(mainConfFile)) {
        try (InputStream mainConfInputStream = Files.newInputStream(mainConfFile)) {
          return ConfigFactory.parseReader(new InputStreamReader(mainConfInputStream, Charsets.UTF_8));
        }
      }
      return ConfigFactory.empty();
    } catch (IOException e) {
      throw new RuntimeException(String.format("Error while getting config for configKey: \"%s\"", configKey), e);
    }
  }
614578
private Config loadJavaPropsWithFallback(Path propertiesPath, Config fallback) throws IOException {

    PropertiesConfiguration propertiesConfiguration = new PropertiesConfiguration();
    try (InputStreamReader inputStreamReader = new InputStreamReader(this.fs.open(propertiesPath),
        Charsets.UTF_8)) {
      propertiesConfiguration.setDelimiterParsingDisabled(ConfigUtils.getBoolean(fallback,
    		  PROPERTY_DELIMITER_PARSING_ENABLED_KEY, DEFAULT_PROPERTY_DELIMITER_PARSING_ENABLED_KEY));
      propertiesConfiguration.load(inputStreamReader);

      Config configFromProps =
          ConfigUtils.propertiesToConfig(ConfigurationConverter.getProperties(propertiesConfiguration));

      return ConfigFactory.parseMap(ImmutableMap.of(ConfigurationKeys.JOB_CONFIG_FILE_PATH_KEY,
          PathUtils.getPathWithoutSchemeAndAuthority(propertiesPath).toString()))
          .withFallback(configFromProps)
          .withFallback(fallback);
    } catch (ConfigurationException ce) {
      throw new IOException(ce);
    }
  }
309563
private static URL getConfigUrl() throws ConfigurationException {
        String spec = System.getProperty(CONFIG_URL_PROPERTY_NAME);
        if (spec == null) {
            spec = DEFAULT_CONFIG_URL;
        }

        URL configUrl = null;
        try {
            configUrl = new URL(spec);
            configUrl.openStream().close(); // catches well-formed but bogus URLs
        } catch (Exception e) {
            try {
                File f = new File(spec);
                if (f.exists()) {
                    configUrl = new URL("file:///" + f.getCanonicalPath());
                }
            } catch( Exception ex) {
            }
        }

        if (configUrl == null) {
            ClassLoader loader = ServerParams.class.getClassLoader();
            configUrl = loader.getResource(spec);

            if (configUrl == null) {
                throw new ConfigurationException("Can't find file/resource: \"" + spec + "\".");
            }
        }

        return configUrl;
    }
896522
public Properties getConfig() {
    try {
      Properties properties = new Properties();
      if (null != resources.getGlobal()) populateConfigItems(properties, resources.getGlobal());

      if (null != resources.getLocals()) {
        for (URL url : resources.getLocals()) {
          populateConfigItems(properties, url);
        }
      }

      if (null != resources.getUser()) populateConfigItems(properties, resources.getUser());
      return properties;
    } catch (Exception e) {
      logger.error("Exception", e);
      throw new RuntimeException(e);
    }
  }
689480
@SuppressWarnings("unchecked")
    @Override
    public T readConfig(String filePath) throws ConfigurationException {
        try {
            YamlReader reader = new YamlReader(new FileReader(filePath));
            reader.getConfig().setClassTag(clazz.getSimpleName(), clazz);
            return (T) reader.read();
        } catch (FileNotFoundException e) {
            throw new ConfigurationException("Configuration Exception", "CONF_001", e);
        } catch (YamlException e) {
            throw new ConfigurationException("Configuration Exception", "CONF_002", e);
        }
    }
493919
static Path getEnvironemtVariableConfigFilePath() {
        final String value = System.getenv(ENVIRONMENT_CONFIG_VARIABLE_NAME);
        return Paths.get(value);
    }
1098367
public void loadConfig(final String path)
	{
		try {

			ConfigurationReader reader = new ConfigurationReader(path);
			ConfigSettings settings = reader.read();

			clear();

			this.type = settings.type;
			this.parameterMap = settings.parameterMap;
			this.archives = settings.archives;

		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
307424
protected org.apache.commons.configuration.Configuration getApplicationConfiguration() {
        try {
            return ApplicationProperties.get();
        } catch (AtlasException e) {
            LOG.warn("Error reading application configuration", e);
        }
        return null;
    }
815775
protected static Configuration getConfig(String path) {
		if (cfg == null) {
			cfg = new Configuration();
			cfg.setClassForTemplateLoading(TemplateUtil.class, path == null ? "/templates" : path);
			cfg.setLocale(Locale.US);
			cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
		}
		return cfg;
	}
16097
public final Configuration getConfig(final File configFile, final InputStream configData)
            throws IOException {
        final Configuration configuration = this.context.getBean(Configuration.class);
        configuration.setConfigurationFile(configFile);
        MapfishPrintConstructor.setConfigurationUnderConstruction(configuration);

        final Configuration config =
                this.yaml.load(new InputStreamReader(configData, "UTF-8"));
        if (this.doValidation) {
            final List<Throwable> validate = config.validate();
            if (!validate.isEmpty()) {
                StringBuilder errors = new StringBuilder();
                for (Throwable throwable: validate) {
                    errors.append("\n\t* ").append(throwable.getMessage());
                    LOGGER.error("Configuration Error found", throwable);
                }
                throw new Error(errors.toString(), validate.get(0));
            }
        }
        return config;
    }