javax.mail.internet
Class MimeBodyPart

java.lang.Object
  extended byjavax.mail.BodyPart
      extended byjavax.mail.internet.MimeBodyPart
All Implemented Interfaces:
MimePart, Part

public class MimeBodyPart
extends BodyPart
implements MimePart

Version:
$Revision: 1.3 $ $Date: 2004/03/10 10:00:28 $

Field Summary
protected  byte[] content
           
protected  InputStream contentStream
           
protected  javax.activation.DataHandler dh
           
protected  InternetHeaders 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)
           
 Enumeration getAllHeaderLines()
           
 Enumeration getAllHeaders()
           
 Object getContent()
           
 String getContentID()
           
 String[] getContentLanguage()
           
 String getContentMD5()
           
protected  InputStream getContentStream()
           
 String getContentType()
           
 javax.activation.DataHandler getDataHandler()
           
 String getDescription()
           
 String getDisposition()
           
 String getEncoding()
           
 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()
           
 boolean isMimeType(String type)
           
 void removeHeader(String name)
           
 void setContent(Multipart content)
           
 void setContent(Object content, String type)
           
 void setContentID(String cid)
           
 void setContentLanguage(String[] languages)
           
 void setContentMD5(String md5)
           
 void setDataHandler(javax.activation.DataHandler handler)
           
 void setDescription(String description)
           
 void setDescription(String description, String charset)
           
 void setDisposition(String disposition)
           
 void setFileName(String name)
           
 void setHeader(String name, String value)
           
 void setText(String text)
           
 void setText(String text, String charset)
           
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

content

protected byte[] content

contentStream

protected InputStream contentStream

dh

protected javax.activation.DataHandler dh

headers

protected InternetHeaders headers
Constructor Detail

MimeBodyPart

public MimeBodyPart()

MimeBodyPart

public MimeBodyPart(InputStream in)
             throws MessagingException

MimeBodyPart

public MimeBodyPart(InternetHeaders headers,
                    byte[] content)
             throws MessagingException
Method Detail

addHeader

public void addHeader(String name,
                      String value)
               throws MessagingException
Specified by:
addHeader in interface Part
Throws:
MessagingException

addHeaderLine

public void addHeaderLine(String line)
                   throws MessagingException
Specified by:
addHeaderLine in interface MimePart
Throws:
MessagingException

getAllHeaderLines

public Enumeration getAllHeaderLines()
                              throws MessagingException
Specified by:
getAllHeaderLines in interface MimePart
Throws:
MessagingException

getAllHeaders

public Enumeration getAllHeaders()
                          throws MessagingException
Specified by:
getAllHeaders in interface Part
Throws:
MessagingException

getContent

public Object getContent()
                  throws IOException,
                         MessagingException
Specified by:
getContent in interface Part
Throws:
IOException
MessagingException

getContentID

public String getContentID()
                    throws MessagingException
Specified by:
getContentID in interface MimePart
Throws:
MessagingException

getContentLanguage

public String[] getContentLanguage()
                            throws MessagingException
Specified by:
getContentLanguage in interface MimePart
Throws:
MessagingException

getContentMD5

public String getContentMD5()
                     throws MessagingException
Specified by:
getContentMD5 in interface MimePart
Throws:
MessagingException

getContentStream

protected InputStream getContentStream()
                                throws MessagingException
Throws:
MessagingException

getContentType

public String getContentType()
                      throws MessagingException
Specified by:
getContentType in interface Part
Throws:
MessagingException

getDataHandler

public javax.activation.DataHandler getDataHandler()
                                            throws MessagingException
Specified by:
getDataHandler in interface Part
Throws:
MessagingException

getDescription

public String getDescription()
                      throws MessagingException
Specified by:
getDescription in interface Part
Throws:
MessagingException

getDisposition

public String getDisposition()
                      throws MessagingException
Specified by:
getDisposition in interface Part
Throws:
MessagingException

getEncoding

public String getEncoding()
                   throws MessagingException
Specified by:
getEncoding in interface MimePart
Throws:
MessagingException

getFileName

public String getFileName()
                   throws MessagingException
Specified by:
getFileName in interface Part
Throws:
MessagingException

getHeader

public String[] getHeader(String name)
                   throws MessagingException
Specified by:
getHeader in interface Part
Throws:
MessagingException

getHeader

public String getHeader(String name,
                        String delimiter)
                 throws MessagingException
Specified by:
getHeader in interface MimePart
Throws:
MessagingException

getInputStream

public InputStream getInputStream()
                           throws IOException,
                                  MessagingException
Specified by:
getInputStream in interface Part
Throws:
IOException
MessagingException

getLineCount

public int getLineCount()
                 throws MessagingException
Specified by:
getLineCount in interface Part
Throws:
MessagingException

getMatchingHeaderLines

public Enumeration getMatchingHeaderLines(String[] names)
                                   throws MessagingException
Specified by:
getMatchingHeaderLines in interface MimePart
Throws:
MessagingException

getMatchingHeaders

public Enumeration getMatchingHeaders(String[] name)
                               throws MessagingException
Specified by:
getMatchingHeaders in interface Part
Throws:
MessagingException

getNonMatchingHeaderLines

public Enumeration getNonMatchingHeaderLines(String[] names)
                                      throws MessagingException
Specified by:
getNonMatchingHeaderLines in interface MimePart
Throws:
MessagingException

getNonMatchingHeaders

public Enumeration getNonMatchingHeaders(String[] name)
                                  throws MessagingException
Specified by:
getNonMatchingHeaders in interface Part
Throws:
MessagingException

getRawInputStream

public InputStream getRawInputStream()
                              throws MessagingException
Throws:
MessagingException

getSize

public int getSize()
            throws MessagingException
Specified by:
getSize in interface Part
Throws:
MessagingException

isMimeType

public boolean isMimeType(String type)
                   throws MessagingException
Specified by:
isMimeType in interface Part
Throws:
MessagingException

removeHeader

public void removeHeader(String name)
                  throws MessagingException
Specified by:
removeHeader in interface Part
Throws:
MessagingException

setContent

public void setContent(Multipart content)
                throws MessagingException
Specified by:
setContent in interface Part
Throws:
MessagingException

setContent

public void setContent(Object content,
                       String type)
                throws MessagingException
Specified by:
setContent in interface Part
Throws:
MessagingException

setContentID

public void setContentID(String cid)
                  throws MessagingException
Throws:
MessagingException

setContentLanguage

public void setContentLanguage(String[] languages)
                        throws MessagingException
Specified by:
setContentLanguage in interface MimePart
Throws:
MessagingException

setContentMD5

public void setContentMD5(String md5)
                   throws MessagingException
Specified by:
setContentMD5 in interface MimePart
Throws:
MessagingException

setDataHandler

public void setDataHandler(javax.activation.DataHandler handler)
                    throws MessagingException
Specified by:
setDataHandler in interface Part
Throws:
MessagingException

setDescription

public void setDescription(String description)
                    throws MessagingException
Specified by:
setDescription in interface Part
Throws:
MessagingException

setDescription

public void setDescription(String description,
                           String charset)
                    throws MessagingException
Throws:
MessagingException

setDisposition

public void setDisposition(String disposition)
                    throws MessagingException
Specified by:
setDisposition in interface Part
Throws:
MessagingException

setFileName

public void setFileName(String name)
                 throws MessagingException
Specified by:
setFileName in interface Part
Throws:
MessagingException

setHeader

public void setHeader(String name,
                      String value)
               throws MessagingException
Specified by:
setHeader in interface Part
Throws:
MessagingException

setText

public void setText(String text)
             throws MessagingException
Specified by:
setText in interface MimePart
Throws:
MessagingException

setText

public void setText(String text,
                    String charset)
             throws MessagingException
Specified by:
setText in interface MimePart
Throws:
MessagingException

updateHeaders

protected void updateHeaders()
                      throws MessagingException
Throws:
MessagingException

writeTo

public void writeTo(OutputStream out)
             throws IOException,
                    MessagingException
Specified by:
writeTo in interface Part
Throws:
IOException
MessagingException


Copyright © 2003-2005 Apache Software Foundation. All Rights Reserved.