Properties properties = new Properties();
File path = new DefaultResourceLoader().getResource(fileName).getFile();
File file = new File(path.toString());
FileInputStream fis = new FileInputStream(file);
properties.load(fis);
properties.setProperty(key, value);
FileOutputStream fos = new FileOutputStream(file);
properties.store(fos, "更新配置文件");
fos.close();
fis.close();
更改properties键值
最新推荐文章于 2021-02-20 17:59:59 发布