java--数据采集系统

java--数据采集系统

ID:37844943

大小:38.00 KB

页数:12页

时间:2019-06-01

java--数据采集系统_第1页
java--数据采集系统_第2页
java--数据采集系统_第3页
java--数据采集系统_第4页
java--数据采集系统_第5页
资源描述:

《java--数据采集系统》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、java--数据采集系统分类:Android开发java讨论区2011-09-0417:18173人阅读评论(0)收藏举报Gather采集类:packagecom.briup.woss.client.impl;importjava.io.*;importjava.sql.Timestamp;importjava.util.*;importcom.briup.pojos.BIDR;importcom.briup.woss.client.Gather;publicclassGatherImplimplementsGather{privatestaticMapmap

2、=newHashMap();/* *读取up.dat文件,up.dat文件存放的是用户没下线的信息, *规定格式为:loginIp,userinfo;*/privatestaticFileReaderfr;privatestaticBufferedReaderbr;static{try{fr=newFileReader("data/up.dat");br=newBufferedReader(fr);Stringstr;while((str=br.readLine())!=null){StringsubStr[]=str.split(";");for(inti=

3、0;igather()throwsException{Collectionc=newArrayList<

4、BIDR>();FileReaderfr=newFileReader("data/radwtmp");BufferedReaderbr=newBufferedReader(fr);intpoint=readPointFile();intp=point;Stringstr=null;inttemp=1;/* *读取point文件来确定从哪一条记录开始读 */while((str=br.readLine())!=null){if(temp<=p){temp++;continue;}point++;Stringstr1[]=str.split("[

5、]+");if(

6、str1[2].equals("7")){map.put(str1[4],str);}elseif(str1[2].equals("8")){Stringsub=(String)map.get(str1[4]);if(sub!=null){Stringinfo[]=sub.split("[

7、]+");Stringlogin_name=info[0].replace("#","");//去除用户名前面的"#"BIDRbidr=newBIDR();//得到登陆用户名bidr.setAAA_login_name(login_name);//得到登陆IPbidr.se

8、tLogin_ip(info[4]);//得到NAS的IPbidr.setNAS_ip(info[1]);/**创建Timestamp类型的ts1(上线),ts2(下线)*/Timestampts1=newTimestamp(Long.parseLong(info[3]+"000"));Timestampts2=newTimestamp(Long.parseLong(str1[3]+"000"));//得到上线时间bidr.setLogin_date(ts1);//得到下线时间bidr.setLogout_date(ts2);//得到上网时间,以分钟计算int

9、secondTime=Integer.parseInt(str1[3])-Integer.parseInt(info[3]);intminuTime=secondTime/60+1;if(secondTime%60==0)minuTime=secondTime/60;bidr.setTime_deration(minuTime);c.add(bidr);map.remove(str1[4]);}}if(point%100==0)break;}br.close();fr.close();updatePointFile(point);//更新书签updateUpF

10、ile();returnc;}//读取

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。