use of org.springframework.beans.factory.config.YamlPropertiesFactoryBean in project cas by apereo.
the class CasCoreBootstrapStandaloneConfiguration method loadYamlProperties.
private Map loadYamlProperties(final Resource... resource) {
final YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
factory.setResolutionMethod(YamlProcessor.ResolutionMethod.OVERRIDE);
factory.setResources(resource);
factory.setSingleton(true);
factory.afterPropertiesSet();
return factory.getObject();
}
use of org.springframework.beans.factory.config.YamlPropertiesFactoryBean in project cas by apereo.
the class DefaultCasConfigurationPropertiesSourceLocator method loadYamlProperties.
private static Map loadYamlProperties(final Resource... resource) {
final YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
factory.setResolutionMethod(YamlProcessor.ResolutionMethod.OVERRIDE);
factory.setResources(resource);
factory.setSingleton(true);
factory.afterPropertiesSet();
return factory.getObject();
}
use of org.springframework.beans.factory.config.YamlPropertiesFactoryBean in project cas by apereo.
the class AddPropertiesToConfigurationCommand method loadYamlPropertiesFromConfigurationFile.
private Properties loadYamlPropertiesFromConfigurationFile(final File filePath) {
final YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
factory.setResolutionMethod(YamlProcessor.ResolutionMethod.OVERRIDE);
factory.setResources(new FileSystemResource(filePath));
factory.setSingleton(true);
factory.afterPropertiesSet();
return factory.getObject();
}
use of org.springframework.beans.factory.config.YamlPropertiesFactoryBean in project gravitee-management-rest-api by gravitee-io.
the class PropertiesConfiguration method graviteeProperties.
@Bean(name = "graviteeProperties")
public static Properties graviteeProperties() throws IOException {
LOGGER.info("Loading Gravitee Management configuration.");
YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
String yamlConfiguration = System.getProperty(GRAVITEE_CONFIGURATION);
Resource yamlResource = new FileSystemResource(yamlConfiguration);
LOGGER.info("\tGravitee Management configuration loaded from {}", yamlResource.getURL().getPath());
yaml.setResources(yamlResource);
Properties properties = yaml.getObject();
LOGGER.info("Loading Gravitee Management configuration. DONE");
return properties;
}
use of org.springframework.beans.factory.config.YamlPropertiesFactoryBean in project alien4cloud by alien4cloud.
the class AlienYamlPropertiesFactoryBeanFactory method get.
/**
* Get a singleton instance of {@link YamlPropertiesFactoryBean}.
*
* @param resourceLoader The loader to use to find the yaml file.
* @return an instance of the {@link YamlPropertiesFactoryBean}.
*/
public static YamlPropertiesFactoryBean get(ResourceLoader resourceLoader) {
if (INSTANCE == null) {
for (String searchLocation : SEARCH_LOCATIONS) {
Resource resource = resourceLoader.getResource(searchLocation + ALIEN_CONFIGURATION_YAML);
if (resource != null && resource.exists()) {
log.info("Loading Alien 4 Cloud configuration from {}", resource.getDescription());
INSTANCE = new YamlPropertiesFactoryBean();
INSTANCE.setResources(new Resource[] { resource });
return INSTANCE;
}
}
}
return INSTANCE;
}
Aggregations