MCPcopy Create free account
hub / github.com/diyhi/bbs / getYml

Method getYml

src/main/java/cms/utils/YmlUtils.java:46–60  ·  view source on GitHub ↗

读取yml文件 @param fileName 文件名称 例如application.yml @return

(String fileName)

Source from the content-addressed store, hash-verified

44 * @return
45 */
46 public static Properties getYml(String fileName){
47 Resource resource = new ClassPathResource(fileName);
48 Properties properties = null;
49 try {
50 YamlPropertiesFactoryBean yamlFactory = new YamlPropertiesFactoryBean();
51 yamlFactory.setResources(resource);
52 properties = yamlFactory.getObject();
53 } catch (Exception e) {
54 if (logger.isErrorEnabled()) {
55 logger.error("读取yml文件错误 "+fileName,e);
56 }
57 return null;
58 }
59 return properties;
60 }
61}

Callers 3

getDatabaseParameterMethod · 0.95
createMethod · 0.95

Calls

no outgoing calls

Tested by 2

getDatabaseParameterMethod · 0.76