PropertyUtil
来源:互联网 发布:mac pro怎么安装双系统 编辑:程序博客网 时间:2024/05/15 14:07
import java.io.FileNotFoundException;import java.io.IOException;import java.io.InputStream;import java.util.Properties;/** * @author dchen * @date 2013-6-21 上午09:26:17 */public class PropertyUtil {public static String getValueByProperty(String key) { Properties p = new Properties(); try { InputStream in = PropertyUtil.class.getResourceAsStream("/config/chat_config.properties"); p.load(in); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } String path = p.getProperty(key); return path; } public static String getValueByProperty(String key, String filePath) { Properties p = new Properties(); String defaultPath = "/config/chat_config.properties"; if (filePath == null) filePath = defaultPath; try { InputStream in = PropertyUtil.class.getResourceAsStream(filePath); p.load(in); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } String path = p.getProperty(key); return path; }}
0 0
- PropertyUtil
- PropertyUtil , 增加 [ bsp1.0]
- PropertyUtil 读取 乱码解决
- PropertyUtil属性文件读写工具类
- ddpush 学习之路 4 PropertyUtil.java
- PropertyUtil属性文件读写工具类
- javascript 判断 history.back() 起作用了没
- 避开并购的IT陷阱
- 使用PowerDesigner 15.2对Oracle进行反向工程
- 财务IT共协作
- 让IT成为利润中心
- PropertyUtil
- 准确率(Precision)、召回率(Recall)以及综合评价指标(F1-Measure )
- Linux给用户添加sudo权限
- linux学习
- 联想购IBM PC等迹象预示中国将成全球IT中心
- Rose里的简单上传下载
- alsa sample rate跟踪 <4>
- 关于处理小数点位数的几个oracle函数()
- OpenLayers中的一些简单应用