linux怎么查看本机内存大小
246
2022-11-21
读写Properties文件
Properties pro = new Properties(); InputStream in = null; try { in = CommonSettings.class.getResourceAsStream("settings.properties"); pro.load(in); in.close(); } catch (Exception e) { throw new RuntimeException(e); } PATH = pro.getProperty("PATH"); URL = pro.getProperty("url"); /** * 写入配置文件 */ public static void writeProperties() { Properties pro = new Properties(); FileOutputStream oFile; File tempFile = new File(TEMP_PROPERTIES); pro.setProperty("URL", URL); pro.setProperty("USER", USER); pro.setProperty("PASSWORD", PASSWORD); pro.setProperty("EXCEL_PATH", EXCEL_PATH); pro.setProperty("appNo", appNo); pro.setProperty("SEQ_DIR", SEQ_DIR); pro.setProperty("OUT_DIR", OUT_DIR); pro.setProperty("TABLES", TABLES); try { if(!tempFile.exists()) { tempFile.getParentFile().mkdirs(); tempFile.createNewFile(); } oFile = new FileOutputStream(tempFile, false); pro.store(new OutputStreamWriter(oFile, "utf-8"), "Comment"); oFile.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~