• 大小: 4.34MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-16
  • 语言: Java
  • 标签:   

资源简介

java实现读取xml文件内容

资源截图

代码片段和文件信息

package org.dom4j.test;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

public class FlashTestDemo{
public void init() throws IOException{
try{
File file = new File(“D:\\FlashDemo\\FlashDemoTest\\src\\org\\dom4j\\test\\Firstxml.xml“);

FileInputStream fis = new FileInputStream(file);
InputStreamReader reader = new InputStreamReader(fis);

BufferedReader read = new BufferedReader(reader);
int count = 0;
String ss = read.readLine();
StringBuffer str = new StringBuffer();

while(!““.equals(ss)&&ss!=null){
count++;
System.out.println(count);
ss = read.readLine();
if(ss!=null){
str.append(ss);
}
}

System.out.println(count);

System.out.println(str.toString());

}catch(FileNotFoundException e){
e.printStackTrace();
}
}

public static void main(String[] args) throws IOException{
FlashTestDemo ft = new FlashTestDemo();
ft.init();
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      87608  2008-07-24 16:09  FlashDemo\.metadata\.log

     文件      21542  2008-07-24 10:55  FlashDemo\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\staticbindings_5.1.1.css

     文件        458  2008-07-24 16:51  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\12\107e1ed15d59001d15eac31ebbeca35a

     文件        779  2008-07-24 16:58  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\13\e02890c55e59001d15eac31ebbeca35a

     文件       1197  2008-07-24 17:40  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\14\b00b97ce6459001d15eac31ebbeca35a

     文件      44883  2008-07-24 10:47  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\17\60d56def3e59001d1fabc4b07ac4e137

     文件       1400  2008-07-24 13:08  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\1b\806ff3b43e59001d1fabc4b07ac4e137

     文件       2859  2008-07-24 16:31  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\1c\0032b6e35a59001d15eac31ebbeca35a

     文件        287  2008-07-24 11:24  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\1d\c09be6243359001d1fabc4b07ac4e137

     文件      48761  2008-07-24 10:47  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\1e\404b77ef3e59001d1fabc4b07ac4e137

     文件       1399  2008-07-24 13:10  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\20\b07009fa3e59001d1fabc4b07ac4e137

     文件          0  2008-07-24 15:59  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\20\f07e33605659001d15eac31ebbeca35a

     文件      44062  2008-07-24 10:47  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\22\60f368ef3e59001d1fabc4b07ac4e137

     文件      57016  2008-07-24 10:47  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\24\70a966ef3e59001d1fabc4b07ac4e137

     文件        304  2008-07-24 16:45  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\25\60937d495d59001d15eac31ebbeca35a

     文件        247  2008-07-24 16:11  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\28\808e381e5859001d15eac31ebbeca35a

     文件        552  2008-07-24 16:53  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\2a\b00cdf275e59001d15eac31ebbeca35a

     文件        531  2008-07-24 16:18  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\2d\50f8c2215959001d15eac31ebbeca35a

     文件        835  2008-07-24 17:01  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\2f\20d61b1a5f59001d15eac31ebbeca35a

     文件        733  2008-07-24 16:58  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\3\0058feb75e59001d15eac31ebbeca35a

     文件       2262  2008-07-24 11:17  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\32\101b23272f59001d1fabc4b07ac4e137

     文件       1535  2008-07-24 12:44  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\34\507fda463b59001d1fabc4b07ac4e137

     文件        139  2008-07-24 15:52  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\34\b09d91a15559001d15eac31ebbeca35a

     文件       1410  2008-07-24 13:01  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\36\50f8a0a53d59001d1fabc4b07ac4e137

     文件       1404  2008-07-24 13:05  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\38\80eca0303e59001d1fabc4b07ac4e137

     文件        369  2008-07-24 11:09  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\3c\605c2ffe2d59001d1fabc4b07ac4e137

     文件       1172  2008-07-24 16:33  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\3e\d0c23f355b59001d15eac31ebbeca35a

     文件       1244  2008-07-24 17:56  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\4\001befe26659001d15eac31ebbeca35a

     文件      46169  2008-07-24 10:47  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\40\501f70ef3e59001d1fabc4b07ac4e137

     文件       2821  2008-07-24 16:32  FlashDemo\.metadata\.plugins\org.eclipse.core.resources\.history\44\b055610a5b59001d15eac31ebbeca35a

............此处省略543个文件信息

评论

共有 条评论

相关资源