没有合适的资源?快使用搜索试试~ 我知道了~
读取配置文件,封装好的方法,直接调用即可!
资源推荐
资源详情
资源评论
public class MainLocation {
public static final String DEFAULT_PROPERTIES_PATH = MainLocation.class.getResource("/").getPath()+"config.properties";
private static Map<String, Properties> ppsMap = new HashMap<String, Properties>();
/**
* 读取默认文件的配置信息,读key返回value
*
* @param key
* @return value
* @throws FileNotFoundException
* @throws FileNotFoundException
*/
public synchronized static final String readlocation(String key) {
synchronized (ppsMap) {
Properties pps = null;
try {
pps = getPropertyFile(DEFAULT_PROPERTIES_PATH);
} catch (FileNotFoundException e) {
SystemExceptionInterceptor se = new SystemExceptionInterceptor();
try {
se.jumpURL();
} catch (IOException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}
return pps == null ? null : pps.getProperty(key);
public static final String DEFAULT_PROPERTIES_PATH = MainLocation.class.getResource("/").getPath()+"config.properties";
private static Map<String, Properties> ppsMap = new HashMap<String, Properties>();
/**
* 读取默认文件的配置信息,读key返回value
*
* @param key
* @return value
* @throws FileNotFoundException
* @throws FileNotFoundException
*/
public synchronized static final String readlocation(String key) {
synchronized (ppsMap) {
Properties pps = null;
try {
pps = getPropertyFile(DEFAULT_PROPERTIES_PATH);
} catch (FileNotFoundException e) {
SystemExceptionInterceptor se = new SystemExceptionInterceptor();
try {
se.jumpURL();
} catch (IOException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}
return pps == null ? null : pps.getProperty(key);
资源评论
「已注销」
- 粉丝: 1
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功