|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.java4less.rmail.MailMsgPart
This is a part of an e-mail. A message is always made of parts. In the simplest case there is just one part that contains text, however one part can contain a file (binary data), a HTML page or other parts (type multipart).
For example, this is a part that contains text:
textpart=new MainMsgPart();
textpart.setData("This is the text",MimeEncoder.QUOTED);
part.addPart(textpart);
this is a part that contains html data:
htmlpart=new MainMsgPart();
htmlpart.ContentType="Text";
htmlpart.ContentSubType="Html";
htmlpart.setData("<html><body>This is the text</body></html>",MimeEncoder.QUOTED);
this is a part that contains binary data:
byte[] binaryData=new {34,13,10,80};
part=new MainMsgPart();
part.ContentType="Application";
part.ContentSubType="Octet-stream";
part.setBinaryData(binaryData,MimeEncoder.BASE64);
Field Summary | |
java.lang.String |
boundary
boundary used to separate subparts. |
java.lang.String |
ContentSubType
see ContentSubType of MailMsg |
java.lang.String |
ContentType
see ContentType of MailMsg |
int |
Encoding
Current encoding of the part. |
java.lang.String |
FileName
File name if the part has "Application" ContentType. |
java.lang.String |
Name
Name of the part. |
int |
partCounter
number of subparts in the part (if ContentType is "Multipart"). |
java.lang.String |
rawHDR
header of the part as sent or received. |
Constructor Summary | |
MailMsgPart()
|
Method Summary | |
void |
addPart(MailMsgPart p)
Adds a subpart to the part. |
byte[] |
getBinaryData()
returns binary content of the file. |
java.lang.String |
getData()
returns the non-binary content. |
java.lang.String |
getHeader()
returns the header of the part in rfc822 format. |
MailMsgPart |
getPart(int num)
returns a subparft of the part. |
boolean |
saveToFile(java.lang.String psFile)
saves the content of the part to a file. |
void |
setBinaryData(byte[] b)
sets the binary content of the part. |
void |
setCodedData(java.lang.String d)
method called by the POP connection to store the received data. |
void |
setData(java.lang.String d,
int encoding)
sets the content of the part if not binary, you must specify an encoding method: MimeEncoder.NO_ENCODE. MimeEncoder.QUOTED. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.lang.String ContentType
public java.lang.String ContentSubType
public int Encoding
public java.lang.String Name
public java.lang.String FileName
public java.lang.String rawHDR
public int partCounter
public java.lang.String boundary
Constructor Detail |
public MailMsgPart()
Method Detail |
public MailMsgPart getPart(int num)
public void addPart(MailMsgPart p)
public void setBinaryData(byte[] b)
public void setData(java.lang.String d, int encoding)
sets the content of the part if not binary, you must specify an encoding method:
MimeEncoder.NO_ENCODE.
MimeEncoder.QUOTED. It is recomemded to use at least this one. It supports caracters like á, ö ...
MimeEncoder.BASE64. Supports binary data.
public java.lang.String getData()
public byte[] getBinaryData()
public void setCodedData(java.lang.String d)
public boolean saveToFile(java.lang.String psFile)
public java.lang.String getHeader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |