add PropertiesFileUtil

This commit is contained in:
shuzheng 2016-10-15 23:18:40 +08:00
parent 0a4b5ba7e9
commit 961be1c55d
1 changed files with 26 additions and 0 deletions

View File

@ -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);
}
}