给个简单点,是sun得
package com.castlez.mail.demo;/*
* @(#)Msgshow.java 1.24 00/10/14
* Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
*/import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
/*
* Demo app that exercises the Message interfaces.
* Show information about and contents of messages.
*
* @author John Mani
* @author Bill Shannon
*/public class ShowMsg
{
static String protocol= "imap";
static String host = "172.16.1.200";
static String user = "my";
static String password = "my";
static String mbox = "INBOX";
static String url = null; static int port = -1;
static boolean verbose = false;
static boolean debug = false;
static boolean showStructure = false;
static boolean showMessage = false; public static void main(String argv[])
{
int msgnum = -1;
try {
// Get a Properties object
Properties props = System.getProperties(); // Get a Session object
Session session = Session.getDefaultInstance(props, null);
session.setDebug(debug);
if (showMessage)
{
MimeMessage msg = new MimeMessage(session, System.in);
dumpPart(msg);
System.exit(0);
} // Get a Store object
Store store = null;
if (url != null)
{
URLName urln = new URLName(url);
store = session.getStore(urln);
store.connect();
}
else
{
if (protocol != null)
store = session.getStore(protocol);
else
store = session.getStore();
// Connect
if (host != null || user != null || password != null)
store.connect(host, port, user, password);
else
store.connect();
} // Open the Folder
Folder folder = store.getDefaultFolder();
if (folder == null)
{
System.out.println("No default folder");
System.exit(1);
}
folder = folder.getFolder(mbox);
if (folder == null)
{
System.out.println("Invalid folder");
System.exit(1);
} // try to open read/write and if that fails try read-only
try
{
folder.open(Folder.READ_WRITE);
}
catch (MessagingException ex)
{
folder.open(Folder.READ_ONLY);
}
int totalMessages = folder.getMessageCount();
if (totalMessages == 0)
{
System.out.println("Empty folder");
folder.close(false);
store.close();
System.exit(1);
}
if (verbose)
{
int newMessages = folder.getNewMessageCount();
System.out.println("Total messages = " + totalMessages);
System.out.println("New messages = " + newMessages);
System.out.println("-------------------------------");
}
if (msgnum == -1)
{
// Attributes & Flags for all messages .. Message[] msgs = folder.getMessages();
// Use a suitable FetchProfile
FetchProfile fp = new FetchProfile();
fp.add(FetchProfile.Item.ENVELOPE);
fp.add(FetchProfile.Item.FLAGS);
fp.add("X-Mailer");
folder.fetch(msgs, fp);
for (int i = 0; i < msgs.length; i++)
{
System.out.println("******************");
//System.out.println("Message's Priority is : " + MessageUtility.getPriority(msgs[i]));
System.out.println("--------------------------");
System.out.println("MESSAGE #" + (i + 1) + ":");
dumpEnvelope(msgs[i]);
// dumpPart(msgs[i]);
}
}
else
{
System.out.println("Getting message number: " + msgnum);
Message m = null;
try
{
m = folder.getMessage(msgnum);
dumpPart(m);
}
catch (IndexOutOfBoundsException iex)
{
System.out.println("Message number out of range");
}
}
folder.close(false);
store.close();
}
catch (Exception ex)
{
System.out.println("Oops, got exception! " + ex.getMessage());
ex.printStackTrace();
System.exit(1);
}
System.exit(0);
}
package com.castlez.mail.demo;/*
* @(#)Msgshow.java 1.24 00/10/14
* Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
*/import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
/*
* Demo app that exercises the Message interfaces.
* Show information about and contents of messages.
*
* @author John Mani
* @author Bill Shannon
*/public class ShowMsg
{
static String protocol= "imap";
static String host = "172.16.1.200";
static String user = "my";
static String password = "my";
static String mbox = "INBOX";
static String url = null; static int port = -1;
static boolean verbose = false;
static boolean debug = false;
static boolean showStructure = false;
static boolean showMessage = false; public static void main(String argv[])
{
int msgnum = -1;
try {
// Get a Properties object
Properties props = System.getProperties(); // Get a Session object
Session session = Session.getDefaultInstance(props, null);
session.setDebug(debug);
if (showMessage)
{
MimeMessage msg = new MimeMessage(session, System.in);
dumpPart(msg);
System.exit(0);
} // Get a Store object
Store store = null;
if (url != null)
{
URLName urln = new URLName(url);
store = session.getStore(urln);
store.connect();
}
else
{
if (protocol != null)
store = session.getStore(protocol);
else
store = session.getStore();
// Connect
if (host != null || user != null || password != null)
store.connect(host, port, user, password);
else
store.connect();
} // Open the Folder
Folder folder = store.getDefaultFolder();
if (folder == null)
{
System.out.println("No default folder");
System.exit(1);
}
folder = folder.getFolder(mbox);
if (folder == null)
{
System.out.println("Invalid folder");
System.exit(1);
} // try to open read/write and if that fails try read-only
try
{
folder.open(Folder.READ_WRITE);
}
catch (MessagingException ex)
{
folder.open(Folder.READ_ONLY);
}
int totalMessages = folder.getMessageCount();
if (totalMessages == 0)
{
System.out.println("Empty folder");
folder.close(false);
store.close();
System.exit(1);
}
if (verbose)
{
int newMessages = folder.getNewMessageCount();
System.out.println("Total messages = " + totalMessages);
System.out.println("New messages = " + newMessages);
System.out.println("-------------------------------");
}
if (msgnum == -1)
{
// Attributes & Flags for all messages .. Message[] msgs = folder.getMessages();
// Use a suitable FetchProfile
FetchProfile fp = new FetchProfile();
fp.add(FetchProfile.Item.ENVELOPE);
fp.add(FetchProfile.Item.FLAGS);
fp.add("X-Mailer");
folder.fetch(msgs, fp);
for (int i = 0; i < msgs.length; i++)
{
System.out.println("******************");
//System.out.println("Message's Priority is : " + MessageUtility.getPriority(msgs[i]));
System.out.println("--------------------------");
System.out.println("MESSAGE #" + (i + 1) + ":");
dumpEnvelope(msgs[i]);
// dumpPart(msgs[i]);
}
}
else
{
System.out.println("Getting message number: " + msgnum);
Message m = null;
try
{
m = folder.getMessage(msgnum);
dumpPart(m);
}
catch (IndexOutOfBoundsException iex)
{
System.out.println("Message number out of range");
}
}
folder.close(false);
store.close();
}
catch (Exception ex)
{
System.out.println("Oops, got exception! " + ex.getMessage());
ex.printStackTrace();
System.exit(1);
}
System.exit(0);
}
{
if (p instanceof Message)
dumpEnvelope((Message)p); /** Dump input stream ..
InputStream is = p.getInputStream();
// If "is" is not already buffered, wrap a BufferedInputStream
// around it.
if (!(is instanceof BufferedInputStream))
is = new BufferedInputStream(is);
int c;
while ((c = is.read()) != -1)
System.out.write(c);
**/
pr("CONTENT-TYPE: " + p.getContentType());
String filename = p.getFileName();
if (filename != null)
pr("FILENAME: " + filename); /*
* Using isMimeType to determine the content type avoids
* fetching the actual content data until we need it.
*/
if (p.isMimeType("text/plain"))
{
pr("This is plain text");
pr("---------------------------");
if (!showStructure)
System.out.println((String)p.getContent());
}
else if (p.isMimeType("multipart/*"))
{
pr("This is a Multipart");
pr("---------------------------");
Multipart mp = (Multipart)p.getContent();
level++;
int count = mp.getCount();
for (int i = 0; i < count; i++)
dumpPart(mp.getBodyPart(i));
level--;
}
else if (p.isMimeType("message/rfc822"))
{
pr("This is a Nested Message");
pr("---------------------------");
level++;
dumpPart((Part)p.getContent());
level--;
}
else if (!showStructure)
{
/*
* If we actually want to see the data, and it's not a
* MIME type we know, fetch it and check its Java type.
*/
Object o = p.getContent();
if (o instanceof String)
{
pr("This is a string");
pr("---------------------------");
System.out.println((String)o);
}
else if (o instanceof InputStream)
{
pr("This is just an input stream");
pr("---------------------------");
InputStream is = (InputStream)o;
int c;
while ((c = is.read()) != -1)
System.out.write(c);
}
else
{
pr("This is an unknown type");
pr("---------------------------");
pr(o.toString());
}
}
else
{
pr("This is an unknown type");
pr("---------------------------");
}
} public static void dumpEnvelope(Message m) throws Exception
{
System.out.println("--Msgshow.dumpEnvelope--");
pr("This is the message envelope");
pr("---------------------------");
Address[] a;
// FROM
if ((a = m.getFrom()) != null)
{
for (int j = 0; j < a.length; j++)
pr("FROM: " + a[j].toString());
} // TO
if ((a = m.getRecipients(Message.RecipientType.TO)) != null)
{
for (int j = 0; j < a.length; j++)
pr("TO: " + a[j].toString());
} // SUBJECT
pr("SUBJECT: " + m.getSubject()); // DATE
Date d = m.getSentDate();
pr("SendDate: " + (d != null ? d.toString() : "UNKNOWN")); // FLAGS
Flags flags = m.getFlags();
StringBuffer sb = new StringBuffer();
Flags.Flag[] sf = flags.getSystemFlags(); // get the system flags boolean first = true;
for (int i = 0; i < sf.length; i++)
{
String s;
Flags.Flag f = sf[i];
if (f == Flags.Flag.ANSWERED)
s = "\\Answered";
else if (f == Flags.Flag.DELETED)
s = "\\Deleted";
else if (f == Flags.Flag.DRAFT)
s = "\\Draft";
else if (f == Flags.Flag.FLAGGED)
s = "\\Flagged";
else if (f == Flags.Flag.RECENT)
s = "\\Recent";
else if (f == Flags.Flag.SEEN)
s = "\\Seen";
else
continue; // skip it
if (first)
first = false;
else
sb.append(' ');
sb.append(s);
}
String[] uf = flags.getUserFlags(); // get the user flag strings
for (int i = 0; i < uf.length; i++)
{
if (first)
first = false;
else
sb.append(' ');
sb.append(uf[i]);
}
pr("FLAGS: " + sb.toString());
// X-MAILER
String[] hdrs = m.getHeader("X-Mailer");
if (hdrs != null)
pr("X-Mailer: " + hdrs[0]);
else
pr("X-Mailer NOT available");
}
static String indentStr = " ";
static int level = 0;
/**
* Print a, possibly indented, string.
*/
public static void pr(String s) {
if (showStructure)
System.out.print(indentStr.substring(0, level * 2));
System.out.println(s);
}
}
开个玩笑而已,公司的商业机密,不能给你啊。
楼上的两位给的代码,都是最简单的,根本解决不了中文附件,符合邮件,html邮件显示等等。
import javax.mail.*;
import javax.mail.internet.*;
import java.io.*;
import java.text.DecimalFormat;public class MailAccept {
private String gpstrhost = null; //pop服务器地址
private int gphostport = 110; //服务器端口
private String gpstrusername = null; //用户名
private String gpstrpassword = null; //密码
protected Message gpmessage[];
protected Folder folder = null;
private Store store = null;
public void setUserInfo(String host,String port,String username,String password) {
this.gpstrhost = host;
this.gphostport = Integer.parseInt(port);
this.gpstrusername = username;
this.gpstrpassword = password;
}
/**
* 与pop3服务器连接,并返回INBOX中的消息
* @return 返回所有INBOX中的消息
*/
public void getMessageArray() throws MessagingException,NoSuchProviderException,ArrayIndexOutOfBoundsException{ Properties mprops = new Properties();
Session msession = Session.getInstance(mprops, null);
//get store
store = msession.getStore("pop3");
store.connect(gpstrhost,gphostport,gpstrusername,gpstrpassword);
// Open the Folder
folder = store.getDefaultFolder();
if (folder == null) {
System.out.println("No default folder");
System.exit(1);
}
folder = folder.getFolder("INBOX");
if (folder == null) {
System.out.println("Invalid folder");
System.exit(1);
}
try {
folder.open(Folder.READ_WRITE);
} catch (MessagingException ex) {
folder.open(Folder.READ_ONLY);
}
gpmessage = folder.getMessages();
}
/**
* 得到消息的个数
* @return 返回消息的个数
*/
public int getMessageLength() {
return gpmessage.length;
}
/**
* 对字符串进行解码处理
* @param s 要转换的字符串
* @return 返回转换后的字符串
*/
public static String decodeWord(String s) {
if(!s.startsWith("=?"))
return strdata.getstr(s); //如果没有编码就进行内码转换,调用str类里getstr()
if (s.indexOf("=?")!=-1) {
int i = 2;
int j;
if((j = s.indexOf(63, i)) == -1)
return s;
String s1 = (s.substring(i, j));
i = j + 1;
if((j = s.indexOf(63, i)) == -1)
return s;
String s2 = s.substring(i, j);
i = j + 1;
if((j = s.indexOf("?=", i)) == -1)
return s;
String s3 = s.substring(i, j);
try {
ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(s3.getBytes());
Object obj;
if(s2.equalsIgnoreCase("B"))
obj = new com.sun.mail.util.BASE64DecoderStream(bytearrayinputstream);
else
if(s2.equalsIgnoreCase("Q"))
obj = new com.sun.mail.util.QDecoderStream(bytearrayinputstream);
else
return s;
int k = bytearrayinputstream.available();
byte abyte0[] = new byte[k];
k = ((InputStream) (obj)).read(abyte0, 0, k);
return new String(abyte0, 0, k );
}
catch(Exception e) {
return s;
}
}
return s;
}
protected void finalize() {
try {
folder.close(false);
store.close();
folder = null;
store = null;
}
catch (MessagingException e) {
}
}}
import javax.mail.*;
import javax.mail.internet.*;
import java.io.*;
import java.net.URLEncoder;public class MailContent extends MailAccept {
private String s1; //消息的内容
private String s3 = new String(); //消息的附件
static String path; //附件保存的路径
private String path2 = ""; //当前URL
private String fileurlname = ""; //附件链接名称
int eventtype; //如果eventtype=1,不显示附件
private String filename = new String(); //附件文件名
private Message message; //邮件消息
private String coding = new String(); //消息所用的编码
/**
* 判断消息是否有删除标记
* @return 有返回true,没有返回false
*/
public boolean isMsgDel() {
boolean isdel = false;
try {
if(message.isSet(Flags.Flag.DELETED)) isdel = true;
}
catch(MessagingException e) {
System.err.println("MailContent.isMsgDel(): " + e.toString());
}
return isdel;
}
/**
* 为消息加上DELETED标签,并调用folderClose()删除
* @return 成功返回true,失败返回false
*/
public boolean setFlagsDel() {
boolean isdel = false;
try {
message.setFlag(Flags.Flag.DELETED,true);
isdel = true;
}
catch(MessagingException e) {
isdel = false;
}
finally {
return isdel;
}
}
/**
* 关闭Folder时删除带DELETED标签的消息
*/
public void folderClose() {
try {
folder.close(true);
}
catch(MessagingException e) {
System.err.println("MailAccept.folderclose(): "+e.toString());
}
}
/**
* 得到消息中的From信息
* @return 返回From信息
*/
public String getMailFrom() {
String maddress = new String();
Address address[] = null;
try {
address = message.getFrom();
for (int j = 0; j < address.length; j++)
maddress = maddress+decodeWord(address[j].toString());
}
catch(MessagingException e) {
System.err.println("MailContent.getMailFrom(): " + e.toString());
}
return maddress;
}
/**
* 得到消息中的To地址信息
* @return 返回To地址信息
*/
public String getMailTo() {
String maddress = new String();
Address address[] = null;
try {
address = message.getRecipients(Message.RecipientType.TO);
for (int j = 0; j < address.length; j++)
maddress = maddress+decodeWord(address[j].toString());
}
catch(MessagingException e) {
System.err.println("MailContent.getMailTo(): " + e.toString());
}
return maddress;
}
/**
* 得到消息中的CC地址信息
* @return 返回CC地址信息
*/
public String getMailCc() {
String maddress = new String();
Address address[] = null;
try {
address = message.getRecipients(Message.RecipientType.CC);
if (address == null)
return "无";
for (int j = 0; j < address.length; j++)
maddress = maddress+decodeWord(address[j].toString());
}
catch(MessagingException e) {
System.err.println("MailContent.getMailCc(): " + e.toString());
}
return maddress;
}
/**
* 得到消息中的时间信息
* @return 返回时间信息
*/
public String getMailDate() {
String dateString = "";
try {
Date date = message.getSentDate();
if (date==null) return "unknown";
java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dateString = formatter.format(date);
}
catch(MessagingException e) {
System.err.println("MailContent.getMailDate(): " + e.toString());
}
return dateString;
}
/**
* 判断消息是否为新消息
* @return 是新消息返回true,反之返回false
*/
public boolean getMailNew() {
boolean mailnew = false;
try {
message.setFlag(Flags.Flag.RECENT,false);
if (message.isSet(Flags.Flag.RECENT))
mailnew = true;
}
catch(MessagingException e) {
return false;
}
return mailnew;
}
/**
* 得到消息的大小
* @return 返回消息的大小,以K为单位
*/
public int getMailSize() {
int size = 0;
try {
Integer intsize = new Integer(message.getSize());
size = intsize.intValue();
}
catch(MessagingException e) {
System.err.println("MailContent.getMailSize(): " + e.getMessage());
}
return size;
}
/**
* 得到消息中的主题信息
* @return 返回主题信息
*/
public String getMailSubject() {
boolean bgetstr;
String temps;
String[] mastr = null;
String _subject="";
try {
mastr = message.getHeader("Subject");
if (mastr!=null)
_subject=mastr[0];
else
_subject="";
temps = decodeWord(_subject); //对数据进行解码处理
}
catch(MessagingException E) {
return _subject;
}
if (temps.length()==0) {
temps="无主题";
}
return temps;
}
/**
* 得到消息的原文
* @return 返回消息的原文
*/
public String getYuanText() {
String s = null;
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
message.writeTo(out);
s = out.toString();
out.close();
}
catch(Exception e) {
System.err.println("MailContent.getYuanText(): " + e.getMessage());
}
return s;
}
* 得到消息中的内容信息
* @param path 附件保存的路径
* @param path2 当前URL
* @param eventtype 如果eventtype=1,不显示附件
* @return 返回内容信息
*/
//调用此方法前,要调用MailAccept.getMessageArray()方法得到message
public String getMailContent(String path,String path2,int eventtype) {
String s = "";
String sct = "";
this.path = path; //得到附件保存的路径
this.path2 = strdata.indexStr(path2,"/",8); //得到当前URL
this.eventtype = eventtype;
try {
Object o = message.getContent(); //返回所有消息内容
sct = message.getContentType(); //返回ContentType信息
if (message.isMimeType("text/plain")||message.isMimeType("text/html")||sct==null) {
//判断ContentType中是否为GB2312或GBK编码
if (strdata.regionStr(sct,"GB2312")||strdata.regionStr(sct,"gb2312")||strdata.regionStr(sct,"GBK")||strdata.regionStr(sct,"GB2312_CHARSET")) {
s = "<pre>"+(String)o+"</pre>";
coding = "GB2312";
}
//判断ContentType中是否为big5编码
else if (strdata.regionStr(sct,"big5")||strdata.regionStr(sct,"Big5")) {
s = "<pre>"+strdata.getstrTobig((String)o)+"</pre>";
coding = "Big5";
}
//如果没有就调用str类中的getstr进行编码转换
else
s = "<pre>"+strdata.getstr((String)o)+"</pre>";
return s;
}
//判断消息中是否有multipart/*头,如果有就进入Multipart处理
if (message.isMimeType("multipart/*")) {
Multipart mp = (Multipart)o;
int cnt = mp.getCount();
for (int j = 0; j < cnt; j++) {
s="<br>"+getPart(mp.getBodyPart(j),j,2,eventtype);
}
}
}
catch(MessagingException e ) {
System.err.println("MailContent.getMailContent(): " + e.toString());
}
catch(Exception e) {
System.err.println("MailContent.getMailContent(): " + e.toString());
}
return s;
}
//对消息multipart/*头下的内容进行处理
private String getPart(Part part, int partNum,int msgNum,int eventtype) throws MessagingException,IOException {
String s="";
String s2="";
String s5="";
String sct = part.getContentType();//返回multipart/*头下的所有内容
boolean blnnum = true;
if (sct == null) {
s="无效";
return s;
}
ContentType ct = new ContentType(sct); //进行头处理
if (ct.match("text/plain") || ct.match("text/html")) {
//判断ContentType中是否为GB2312或GBK编码
if (strdata.regionStr(sct,"GB2312")||strdata.regionStr(sct,"gb2312")||strdata.regionStr(sct,"GBK")||strdata.regionStr(sct,"iso-gb2312")) {
s1 = "<pre>"+(String)part.getContent()+"</pre>";
coding = "GB2312";
}
//判断ContentType中是否为big5编码
else if (strdata.regionStr(sct,"big5")||strdata.regionStr(sct,"Big5")) {
s1 = "<pre>"+strdata.getstrTobig((String)part.getContent())+"</pre>";
coding = "Big5";
}
//如果没有就调用str类中的getstr进行编码转换
else s1 = "<pre>"+strdata.getstr((String)part.getContent())+"</pre>";
}
//如果multipart/*头中还有multipart/alternative头就进行处理
if(part.isMimeType("multipart/*")) {
String s6="";
Multipart mp = (Multipart)part.getContent();
int count = mp.getCount();
for (int i = 0; i < count; i++) {
if(mp.getBodyPart(i).isMimeType("text/plain") || mp.getBodyPart(i).isMimeType("text/html")||mp.getBodyPart(i).isMimeType("multipart/*"))
s5=getPart(mp.getBodyPart(i),i,3,eventtype);
}
return s5;
}
//对附件进行处理
if (blnAttachment(part)) {
if (eventtype==1) return s1; //不显示附件
s3 = "附件:" + getMailAttachment(part) + "<br>" + s3; //得到附件名和下载链接
}
s = s1+s3;
return s;
}
//判断是否有附件
private boolean blnAttachment(Part part) {
boolean bln = false;
try {
//读附件信息,判断是否有附件
String disposition = part.getDisposition();
if (disposition != null && (disposition.equals(Part.ATTACHMENT) || disposition.equals(Part.INLINE)))
bln = true;
}
catch(MessagingException e) {
System.err.println("MailContent.blnAttachment(): " + e.toString());
bln = false;
}
return bln;
}
private String getMailAttachment(Part part) {
String s = "";
try {
//对附件名进行中文处理,把附件内容用流读入,并提供下载路径
s = saveFile(part.getFileName(),part.getInputStream(),path);
}
catch(Exception e) {
System.err.println("MailContent.getMailAttachment(): " + e.toString());
}
return s;
}
private String saveFile(String filename2,InputStream in,String path) {
byte bytes[] = null;
try {
filename = decodeWord(filename2);
fileurlname= strdata.lastStr(filename2,".");
bytes = new byte[in.available()];
File file = new File(path+"\\mail"+fileurlname);
//用附件名创建附件,如果有相同的名称就递加,直到没有相同的文件名
for (int i=0;file.exists();i++) {
fileurlname = i+fileurlname;
file = new File(path+"\\mail"+fileurlname);
}
//建立输入流
FileOutputStream f = new FileOutputStream(file);
in.read(bytes);
f.write(bytes); //把消息中附件部分的内容写到文件中
in.close();
f.close();
}
catch(Exception e) {
System.err.println("MailContent.saveFile(): " + e.getMessage());
}
return "<a href="+path2+"/DownFilelet?filename=mail"+fileurlname+"&savefilename="+URLEncoder.encode(filename)+" target=_blank>"+filename+"</a>";
}
/**
* 得到附件名
* @return 返回附件的名称
*/
public String getfilename() {
return this.filename;
}
/**
* 得到消息
* @param i 消息在消息数组里的编号
*/
public void setPutMessage(int i) throws ArrayIndexOutOfBoundsException {
int n = i-1;
for (int j=n;j<gpmessage.length;j++) {
if (gpmessage[j].getMessageNumber()==i) {
message = gpmessage[j];
return;
}
else {
n = 0;
continue;
}
}
}
/**
* 得到要转换的编码
* @param coding 要转换的编码
*/
//得到要转换的编码,如果this.coding有值,就执行编码转换
public void setCoding(String coding) {
this.coding = coding;
}
/**
* 消息的编码
* @return 返回消息的编码,GB2312或Big5
*/
public String getCoding() {
return (this.coding);
}
/**
* 当前消息
* @return 返回当前的消息
*/
public Message getMessageTo() {
return (this.message);
}
}