//获取文件内容
Date date=new Date();
String time=DateUtil.datetoString(date, "yyyyMMdd");//此处用的自己的工具类
String filename="/home/infra/StaffSyc/"+"USERINFOSYN_+"time"+".TXT";
File file=new File(filename);
if(!file.exists()){
throw new BusiException("文件不存在");
}
if(file.length()==0){
throw new BusiException("文件不能为空");
}
BufferedReader bre=null;
String str="";
List<String> list=new ArrayList<String>();
try{
bre=new BufferedReader(new InputStreamReader(new FileInputStream(filename),"gbk"));
while((str=bre.readLine())!=null){
list.add(str);
}
}catch(IOException e){
e.printStackTrace();
}finally{
if(bre != null){
try {
bre.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}