String profilepath =Object.class.getResource("/").getPath()+"access-token.properties";
非常好用
Properties props=new Properties();
props.load(new FileInputStream(profilepath));
OutputStream fos =new FileOutputStream(profilepath);
String jbarButton = ja.getJbarButton();
props.setProperty("jbar_button",jbarButton);
String jbarContent = ja.getJbarContent();
props.setProperty("jbar_content",jbarContent);
String jbarUrl = ja.getJbarUrl();
props.setProperty("jbar_url",jbarUrl);
String jbarHide = ja.getJbarHide();
String jbarStart = ja.getJbarStart();
if(jbarHide != null && jbarHide != "") {
props.setProperty("jbar_hide","closed");
}else {
props.setProperty("jbar_hide","open");
}
if(jbarStart != null && jbarStart != "") {
props.setProperty("jbar_start","true");
}else {
props.setProperty("jbar_start","false");
}
props.store(fos, "Update value");
fos.close();
修改properties文件
最后修改于 2019-12-12 15:37:26
如果觉得我的文章对你有用,请随意赞赏
扫一扫支付

