| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.mail.BodyPart
javax.mail.internet.MimeBodyPart
public class MimeBodyPart
| Field Summary | |
|---|---|
protected  byte[] | 
content
This message's content (unless sourced from a SharedInputStream).  | 
protected  InputStream | 
contentStream
If the data for this message was supplied by a SharedInputStream
 then this is another such stream representing the content of this message;
 if this field is non-null, then content will be null. | 
protected  DataHandler | 
dh
The DataHandler for this Message's content. | 
protected  InternetHeaders | 
headers
This message's headers.  | 
| Fields inherited from class javax.mail.BodyPart | 
|---|
parent | 
| Fields inherited from interface javax.mail.Part | 
|---|
ATTACHMENT, INLINE | 
| Constructor Summary | |
|---|---|
MimeBodyPart()
 | 
|
MimeBodyPart(InputStream in)
 | 
|
MimeBodyPart(InternetHeaders headers,
                         byte[] content)
 | 
|
| Method Summary | |
|---|---|
 void | 
addHeader(String name,
                   String value)
 | 
 void | 
addHeaderLine(String line)
 | 
 void | 
attachFile(File file)
Attach a file to this body part from a File object.  | 
 void | 
attachFile(String file)
Attach a file to this body part from a file name.  | 
 Enumeration | 
getAllHeaderLines()
 | 
 Enumeration | 
getAllHeaders()
 | 
 Object | 
getContent()
 | 
 String | 
getContentID()
Retrieve the value of the "Content-ID" header.  | 
 String[] | 
getContentLanguage()
 | 
 String | 
getContentMD5()
 | 
protected  InputStream | 
getContentStream()
 | 
 String | 
getContentType()
 | 
 DataHandler | 
getDataHandler()
 | 
 String | 
getDescription()
 | 
 String | 
getDisposition()
Retrieve the message "Content-Disposition" header field.  | 
 String | 
getEncoding()
Retrieves the current value of the "Content-Transfer-Encoding" header.  | 
 String | 
getFileName()
 | 
 String[] | 
getHeader(String name)
 | 
 String | 
getHeader(String name,
                   String delimiter)
 | 
 InputStream | 
getInputStream()
 | 
 int | 
getLineCount()
 | 
 Enumeration | 
getMatchingHeaderLines(String[] names)
 | 
 Enumeration | 
getMatchingHeaders(String[] name)
 | 
 Enumeration | 
getNonMatchingHeaderLines(String[] names)
 | 
 Enumeration | 
getNonMatchingHeaders(String[] name)
 | 
 InputStream | 
getRawInputStream()
 | 
 int | 
getSize()
Return the content size of this message.  | 
 boolean | 
isMimeType(String type)
Tests to see if this message has a mime-type match with the given type name.  | 
 void | 
removeHeader(String name)
 | 
 void | 
saveFile(File file)
Save the body part content to a given target file.  | 
 void | 
saveFile(String file)
Save the body part content to a given target file.  | 
 void | 
setContent(Multipart part)
 | 
 void | 
setContent(Object content,
                     String type)
 | 
 void | 
setContentID(String cid)
 | 
 void | 
setContentLanguage(String[] languages)
 | 
 void | 
setContentMD5(String md5)
 | 
 void | 
setDataHandler(DataHandler handler)
 | 
 void | 
setDescription(String description)
 | 
 void | 
setDescription(String description,
                             String charset)
 | 
 void | 
setDisposition(String disposition)
Set a new dispostion value for the "Content-Disposition" field.  | 
 void | 
setFileName(String name)
 | 
 void | 
setHeader(String name,
                   String value)
 | 
 void | 
setText(String text)
 | 
 void | 
setText(String text,
               String charset)
 | 
 void | 
setText(String text,
               String charset,
               String subtype)
 | 
protected  void | 
updateHeaders()
 | 
 void | 
writeTo(OutputStream out)
 | 
| Methods inherited from class javax.mail.BodyPart | 
|---|
getParent | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected DataHandler dh
DataHandler for this Message's content.
protected byte[] content
protected InputStream contentStream
SharedInputStream
 then this is another such stream representing the content of this message;
 if this field is non-null, then content will be null.
protected InternetHeaders headers
| Constructor Detail | 
|---|
public MimeBodyPart()
public MimeBodyPart(InputStream in)
             throws MessagingException
MessagingException
public MimeBodyPart(InternetHeaders headers,
                    byte[] content)
             throws MessagingException
MessagingException| Method Detail | 
|---|
public int getSize()
            throws MessagingException
getSize in interface PartMessagingException
public int getLineCount()
                 throws MessagingException
getLineCount in interface PartMessagingException
public String getContentType()
                      throws MessagingException
getContentType in interface PartMessagingException
public boolean isMimeType(String type)
                   throws MessagingException
isMimeType in interface Parttype - The tested type name.
MessagingException
public String getDisposition()
                      throws MessagingException
getDisposition in interface PartMessagingException
public void setDisposition(String disposition)
                    throws MessagingException
setDisposition in interface Partdisposition - The new disposition value.
MessagingException
public String getEncoding()
                   throws MessagingException
getEncoding in interface MimePartMessagingException
public String getContentID()
                    throws MessagingException
getContentID in interface MimePartMessagingException
public void setContentID(String cid)
                  throws MessagingException
MessagingException
public String getContentMD5()
                     throws MessagingException
getContentMD5 in interface MimePartMessagingException
public void setContentMD5(String md5)
                   throws MessagingException
setContentMD5 in interface MimePartMessagingException
public String[] getContentLanguage()
                            throws MessagingException
getContentLanguage in interface MimePartMessagingException
public void setContentLanguage(String[] languages)
                        throws MessagingException
setContentLanguage in interface MimePartMessagingException
public String getDescription()
                      throws MessagingException
getDescription in interface PartMessagingException
public void setDescription(String description)
                    throws MessagingException
setDescription in interface PartMessagingException
public void setDescription(String description,
                           String charset)
                    throws MessagingException
MessagingException
public String getFileName()
                   throws MessagingException
getFileName in interface PartMessagingException
public void setFileName(String name)
                 throws MessagingException
setFileName in interface PartMessagingException
public InputStream getInputStream()
                           throws MessagingException,
                                  IOException
getInputStream in interface PartMessagingException
IOException
protected InputStream getContentStream()
                                throws MessagingException
MessagingException
public InputStream getRawInputStream()
                              throws MessagingException
MessagingException
public DataHandler getDataHandler()
                           throws MessagingException
getDataHandler in interface PartMessagingException
public Object getContent()
                  throws MessagingException,
                         IOException
getContent in interface PartMessagingException
IOException
public void setDataHandler(DataHandler handler)
                    throws MessagingException
setDataHandler in interface PartMessagingException
public void setContent(Object content,
                       String type)
                throws MessagingException
setContent in interface PartMessagingException
public void setText(String text)
             throws MessagingException
setText in interface MimePartsetText in interface PartMessagingException
public void setText(String text,
                    String charset)
             throws MessagingException
setText in interface MimePartMessagingException
public void setText(String text,
                    String charset,
                    String subtype)
             throws MessagingException
setText in interface MimePartMessagingException
public void setContent(Multipart part)
                throws MessagingException
setContent in interface PartMessagingException
public void writeTo(OutputStream out)
             throws IOException,
                    MessagingException
writeTo in interface PartIOException
MessagingException
public String[] getHeader(String name)
                   throws MessagingException
getHeader in interface PartMessagingException
public String getHeader(String name,
                        String delimiter)
                 throws MessagingException
getHeader in interface MimePartMessagingException
public void setHeader(String name,
                      String value)
               throws MessagingException
setHeader in interface PartMessagingException
public void addHeader(String name,
                      String value)
               throws MessagingException
addHeader in interface PartMessagingException
public void removeHeader(String name)
                  throws MessagingException
removeHeader in interface PartMessagingException
public Enumeration getAllHeaders()
                          throws MessagingException
getAllHeaders in interface PartMessagingException
public Enumeration getMatchingHeaders(String[] name)
                               throws MessagingException
getMatchingHeaders in interface PartMessagingException
public Enumeration getNonMatchingHeaders(String[] name)
                                  throws MessagingException
getNonMatchingHeaders in interface PartMessagingException
public void addHeaderLine(String line)
                   throws MessagingException
addHeaderLine in interface MimePartMessagingException
public Enumeration getAllHeaderLines()
                              throws MessagingException
getAllHeaderLines in interface MimePartMessagingException
public Enumeration getMatchingHeaderLines(String[] names)
                                   throws MessagingException
getMatchingHeaderLines in interface MimePartMessagingException
public Enumeration getNonMatchingHeaderLines(String[] names)
                                      throws MessagingException
getNonMatchingHeaderLines in interface MimePartMessagingException
protected void updateHeaders()
                      throws MessagingException
MessagingException
public void attachFile(File file)
                throws IOException,
                       MessagingException
file - The source File object.
IOException
MessagingException
public void attachFile(String file)
                throws IOException,
                       MessagingException
file - The source file name.
IOException
MessagingException
public void saveFile(File file)
              throws IOException,
                     MessagingException
file - The File object used to store the information.
IOException
MessagingException
public void saveFile(String file)
              throws IOException,
                     MessagingException
file - The file name used to store the information.
IOException
MessagingException
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||