package com.easymap.util;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
public class ReadFile {
private static String filepath="E:/WB_DB_TMP";
public String getFileList(){
File filelist = new File(filepath);
List list = Arrays.asList(filelist.list());
StringBuffer sb = new StringBuffer();
File f = null;
for(int i=0;i<list.size();i++){
f = new File(filepath+"/"+list.get(i));
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = dbf.newDocumentBuilder();
Document doc
java读取文件夹里的所有xml文件内容
最新推荐文章于 2022-10-10 13:44:53 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)