All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ck.email.EmailUtil Maven / Gradle / Ivy

There is a newer version: 2.5.3.RELEASE
Show newest version
//package com.ck.email;
//
//import java.io.BufferedReader;
//import java.io.File;
//import java.io.IOException;
//import java.io.InputStream;
//import java.io.InputStreamReader;
//
//import org.dom4j.Document;
//import org.dom4j.Element;
//import org.dom4j.io.SAXReader;
//
//import com.cbeid.zyw.util.Constants;
//import com.cbeid.zyw.util.RSAUtil;
//import com.cbeid.zyw.util.ReadHtmlFile;
//
//import javax.swing.text.Document;
//import javax.swing.text.Element;
//
//public class EmailUtil {
//
//
//	public String ReaderXML(String path) {
//		String str = null;
//		str = reader(path);
//		return str;
//	}
//	/**
//	 *
//	 * @param path 	读取路径
//	 * @param charset  设置编码
//	 * @return
//	 */
//	public String ReaderTXT(String path, String charset) {
//		StringBuffer buffer = new StringBuffer();
//		try {
//			InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(path);
//			BufferedReader in = new BufferedReader(new InputStreamReader(inputStream,charset)); //读取时设置编码,否则会乱码
//			buffer = new StringBuffer();
//			String line = "";
//			while ((line = in.readLine()) != null) {
//				buffer.append(line+"\n");
//			}
//		} catch (IOException e) {
//			e.printStackTrace();
//		}
//		return buffer.toString();
//	}
//
//	private String reader(String path) {
//		SAXReader reader = new SAXReader();
//		String str = null;
//		try {
//			InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(path);
//			BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
//			StringBuffer buffer = new StringBuffer();
//			String line = "";
//			while ((line = in.readLine()) != null) {
//				buffer.append(line);
//			}
//
//			Document d = reader.read(new File(buffer.toString()));
//			Element e = d.getRootElement();
//			Element htmle = e.element("html");
//			str = htmle.asXML();
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		return str;
//	}
//}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy