use of com.enonic.xp.config.Configuration in project xp by enonic.
the class ConfigLoader method load.
Map<String, String> load(final File file) throws Exception {
final Properties props = new Properties();
try (FileReader reader = new FileReader(file, StandardCharsets.UTF_8)) {
props.load(reader);
}
final ConfigBuilder builder = ConfigBuilder.create();
builder.addAll(props);
final Configuration config = this.interpolator.interpolate(builder.build());
return config.asMap();
}
use of com.enonic.xp.config.Configuration in project xp by enonic.
the class SchedulerConfigImpl method jobs.
@Override
public Set<CreateScheduledJobParams> jobs() {
final Configuration jobConfig = this.config.subConfig(JOB_PROPERTY_PREFIX);
final Set<ScheduledJobName> jobNames = parseNames(jobConfig);
return jobNames.stream().map(name -> parseProperties(name, jobConfig.subConfig(name.getValue() + "."))).collect(Collectors.toSet());
}
use of com.enonic.xp.config.Configuration in project xp by enonic.
the class ApplicationInfoBuilder method buildConfig.
private ScriptObjectMirror buildConfig() {
final ScriptObjectMirror result = this.javascriptHelper.newJsObject();
final Configuration config = this.application.getConfig();
if (config != null) {
result.putAll(config.asMap());
}
return result;
}
Aggregations