XMLUtil.java
Upload User: gtz2001
Upload Date: 2016-12-29
Package Size: 2489k
Code Size: 1k
Category:

WEB Mail

Development Platform:

Java

  1. package net.meybo.util;
  2. import java.io.*;
  3. import org.dom4j.*;
  4. /**
  5.  * 处理 XML 的工具类,它只被 XMLTool 类使用
  6.  * <p>Title: </p>
  7.  * <p>Description: </p>
  8.  * <p>Copyright: Copyright (c) 2005</p>
  9.  * <p>Company:脉博软件 </p>
  10.  * @author:阚吉彬
  11.  * @version 1.0
  12.  */
  13. class XMLUtil{
  14.     XMLUtil(){
  15.     }
  16.     protected static void toXmlFile(Document xmlJDoc, String encoding, String fileName) throws FileNotFoundException, IOException {         
  17.         FileWriter file=new FileWriter(fileName);
  18.         xmlJDoc.write(file);
  19.         file.close();       
  20.     }
  21.     protected static InputStream getInputStream(String xmlStr) throws Exception {
  22.         return new ByteArrayInputStream(xmlStr.getBytes());
  23.     }
  24.     protected static Document buildDocument(Element el) {
  25.         Document doc = null;
  26.         doc=DocumentHelper.createDocument(el);
  27.         return doc;
  28.     }
  29. }