乐趣区

关于java:Java-读取配置文件内容

Java 读取配置文件内容:

Yaml yaml = new Yaml();
InputStream in=App.class.getClassLoader().getResourceAsStream("application.yaml");
Map<String, Object> map = yaml.loadAs(in, Map.class);
String active = ((Map<String, Object>)((Map<String, Object>) map.get("spring")).get("profiles")).get("active").toString();
退出移动版