文件的读写
2014-03-11 22:14
162 查看
public static synchronized Properties getConfigFile(String path)
{
private static Properties ConfigProperties = new Properties();
String configPath = path;
File file = new File(configPath);
BufferedInputStream propertyStream = null;
FileInputStream fis = null;
try
{
if (file.exists())
{
fis = new FileInputStream(configPath);
propertyStream = new BufferedInputStream(fis);
ConfigProperties.load(propertyStream);
return ConfigProperties;
}
else
{
return null;
}
}
catch (Exception e)
{
e.printStackTrace();
return null;
}
finally
{
closeHandle(fis, propertyStream);
}
}
{
private static Properties ConfigProperties = new Properties();
String configPath = path;
File file = new File(configPath);
BufferedInputStream propertyStream = null;
FileInputStream fis = null;
try
{
if (file.exists())
{
fis = new FileInputStream(configPath);
propertyStream = new BufferedInputStream(fis);
ConfigProperties.load(propertyStream);
return ConfigProperties;
}
else
{
return null;
}
}
catch (Exception e)
{
e.printStackTrace();
return null;
}
finally
{
closeHandle(fis, propertyStream);
}
}
相关文章推荐
- 学籍管理系统
- Xcode 5.1发布说明以及iOS 7.1发布
- mongodb基本使用2
- 出现( linker command failed with exit code 1)错误总结
- VLC视频播放器开发--VLC for Android编译
- 名称解析
- ISAPI_Rewrite中文手册
- 学籍管理系统
- 堆与栈的区别
- java 克隆函数
- live555 client 接收rtp数据
- Image转化成Base64字符串再转回Image
- DWR与SSH 配置
- 线程封闭
- 对Servlet及tomcat关系的理解,以及Action与servletAPI的关系,以及httpServletRequest
- github上最火的android开源项目
- QTP问题一
- Pow(x, n)
- 今天特别忙
- Android之旅十一 android中数据存储(1)