下面列出了怎么用org.springframework.boot.env.PropertiesPropertySourceLoader的API类实例代码及写法,或者点击链接到github查看源代码。
private PropertySourceLoader getPropertySourceLoader(String fileName) throws UnSupportConfigFileSuffixException {
if (fileName.contains(PROPERTIES_FILE_EXTENSION)) {
return new PropertiesPropertySourceLoader();
} else if (fileName.contains(YAML_FILE_EXTENSION)) {
return new YamlPropertySourceLoader();
}
LOGGER.error("Failed to recognize file: {}", fileName);
throw new UnSupportConfigFileSuffixException();
}