use of com.wso2telco.core.pcrservice.model.ConfigDTO in project core-util by WSO2Telco.
the class YamlReader method getConfiguration.
/**
* Gets the configuration.
*
* @return the configuration
*/
public static ConfigDTO getConfiguration() {
File file = new File(DEVICE_MGT_CONFIG_PATH);
ConfigDTO configPojo = new ConfigDTO();
// jackson databind
final ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
try {
configPojo = mapper.readValue(file, ConfigDTO.class);
} catch (JsonParseException e) {
log.error("Yaml Parsing Error", e);
} catch (JsonMappingException e) {
log.error("Yaml Mapping Error", e);
} catch (IOException e) {
log.error("Yaml File Error", e);
}
return configPojo;
}
Aggregations