String configs = nacosConfig.getConfig(“background.properties”);
ByteArrayResource byteArrayResource = new ByteArrayResource(configs.getBytes());
try {
Properties properties = PropertiesLoaderUtils.loadProperties(byteArrayResource);
System.out.println(properties);
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(configs);
JSONObject json = JSONObject.parseObject(configs);
System.out.println(json);
获取key=value文件每个key的值
最新推荐文章于 2021-06-15 20:03:59 发布