当前工程读取配置文件示例
生活随笔
收集整理的這篇文章主要介紹了
当前工程读取配置文件示例
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
當(dāng)前工程目錄讀取配置示例:
public static void main(String[] args) {// TODO Auto-generated method stub System.out.println(getConfigPath());}public static String getConfigDir(){String userDir=System.getProperty("user.dir");if(System.getProperty("os.name").toLowerCase().contains("windows")){return userDir+File.separator+"conf";}else{return userDir+File.separator+"conf";}}public static String getConfigPath(){return getConfigDir()+File.separator+"config.properties";}?
轉(zhuǎn)載于:https://www.cnblogs.com/davidwang456/p/4277896.html
總結(jié)
以上是生活随笔為你收集整理的当前工程读取配置文件示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: UNIX下的环境变量--转载
- 下一篇: js 字符及字符串