Search in sources :

Example 21 with PropertiesPropertySource

use of org.springframework.core.env.PropertiesPropertySource in project cas by apereo.

the class CasPropertiesConfiguration method init.

/**
 * Init.
 */
@PostConstruct
public void init() {
    final Properties sysProps = System.getProperties();
    final Properties properties = new Properties();
    if (CasVersion.getVersion() != null) {
        properties.put("info.cas.version", CasVersion.getVersion());
    }
    properties.put("info.cas.date", CasVersion.getDateTime());
    properties.put("info.cas.java.home", sysProps.get("java.home"));
    properties.put("info.cas.java.vendor", sysProps.get("java.vendor"));
    properties.put("info.cas.java.version", sysProps.get("java.version"));
    final PropertiesPropertySource src = new PropertiesPropertySource(CasVersion.class.getName(), properties);
    this.environment.getPropertySources().addFirst(src);
}
Also used : PropertiesPropertySource(org.springframework.core.env.PropertiesPropertySource) CasVersion(org.apereo.cas.util.CasVersion) CasConfigurationProperties(org.apereo.cas.configuration.CasConfigurationProperties) Properties(java.util.Properties) EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) PostConstruct(javax.annotation.PostConstruct)

Aggregations

PropertiesPropertySource (org.springframework.core.env.PropertiesPropertySource)21 Properties (java.util.Properties)18 MutablePropertySources (org.springframework.core.env.MutablePropertySources)8 File (java.io.File)4 IOException (java.io.IOException)3 Map (java.util.Map)3 ByteArrayResource (org.springframework.core.io.ByteArrayResource)3 FileSystemResource (org.springframework.core.io.FileSystemResource)3 Reader (java.io.Reader)2 BeanInitializationException (org.springframework.beans.factory.BeanInitializationException)2 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)2 Resource (org.springframework.core.io.Resource)2 AmazonDynamoDB (com.amazonaws.services.dynamodbv2.AmazonDynamoDB)1 ScanRequest (com.amazonaws.services.dynamodbv2.model.ScanRequest)1 ScanResult (com.amazonaws.services.dynamodbv2.model.ScanResult)1 FileInputStream (java.io.FileInputStream)1 StandardCharsets (java.nio.charset.StandardCharsets)1 Files (java.nio.file.Files)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1