java获取properties文件属性值工具类
import java.util.ResourceBundle;
public class PropertiesConfig {
private static ResourceBundle resource = ResourceBundle.getBundle("config");
public final static String getValue(String key) throws Exception {
return resource.getString(key);
}
public final static String getProperties(String key) {
String result=null;
try {
result=getValue(key);
}catch(Exception e) {
result=null;
}
return result;
}
}