You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
3 years ago
|
package com.eco.plugin.xx.cjccfilter.utils;
|
||
|
|
||
|
import com.fr.io.utils.ResourceIOUtils;
|
||
|
|
||
|
import java.io.BufferedReader;
|
||
|
import java.io.InputStream;
|
||
|
import java.io.InputStreamReader;
|
||
|
import java.util.Properties;
|
||
|
|
||
|
public class PropertiesUtils {
|
||
|
// private static final String RESOURCES_PATH = "config";
|
||
|
// private static ResourceBundle bundle = null;
|
||
|
//
|
||
|
// static {
|
||
|
// bundle = ResourceBundle.getBundle(RESOURCES_PATH);
|
||
|
// }
|
||
|
//
|
||
|
// public static String getProperties(String key){
|
||
|
// return bundle.getString(key);
|
||
|
// }
|
||
|
|
||
|
/**
|
||
|
* 获取web-info下的配置文件
|
||
|
* @param path /resources/wz.properties
|
||
|
* @return
|
||
|
*/
|
||
|
public static Properties getProperties(String path){
|
||
|
Properties p = new Properties();
|
||
|
|
||
|
try{
|
||
|
InputStream is = ResourceIOUtils.read(path);
|
||
|
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));
|
||
|
p.load(bufferedReader);
|
||
|
}catch(Exception e){
|
||
|
FRUtils.FRLogInfo("获取配置文件异常");
|
||
|
}
|
||
|
|
||
|
return p;
|
||
|
}
|
||
|
}
|