add PropertiesFileUtil
This commit is contained in:
parent
0a4b5ba7e9
commit
961be1c55d
|
@ -0,0 +1,26 @@
|
||||||
|
package com.zheng.common.util;
|
||||||
|
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置文件读取工具
|
||||||
|
*
|
||||||
|
* @author shuzheng
|
||||||
|
* @date 2016年10月15日
|
||||||
|
*/
|
||||||
|
public class PropertiesFileUtil {
|
||||||
|
|
||||||
|
private ResourceBundle resourceBundle = null;
|
||||||
|
|
||||||
|
public PropertiesFileUtil(String bundleFile) {
|
||||||
|
resourceBundle = ResourceBundle.getBundle(bundleFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue(String key) {
|
||||||
|
if (null == resourceBundle) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return resourceBundle.getString(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue