javax.mail.internet
Class MimeBodyPart
java.lang.Object
javax.mail.BodyPart
javax.mail.internet.MimeBodyPart
- All Implemented Interfaces:
- MimePart, Part
- public class MimeBodyPart
- extends BodyPart
- implements MimePart
- Version:
- $Rev: 219255 $ $Date: 2005-07-15 17:00:39 -0600 (Fri, 15 Jul 2005) $
Field Summary |
protected byte[] |
content
This message's content (unless sourced from a SharedInputStream). |
protected java.io.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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dh
protected DataHandler dh
- The
DataHandler
for this Message's content.
content
protected byte[] content
- This message's content (unless sourced from a SharedInputStream).
contentStream
protected java.io.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.
headers
protected InternetHeaders headers
- This message's headers.
MimeBodyPart
public MimeBodyPart()
MimeBodyPart
public MimeBodyPart(java.io.InputStream in)
throws MessagingException
MimeBodyPart
public MimeBodyPart(InternetHeaders headers,
byte[] content)
throws MessagingException
getSize
public int getSize()
throws MessagingException
- Specified by:
getSize
in interface Part
- Throws:
MessagingException
getLineCount
public int getLineCount()
throws MessagingException
- Specified by:
getLineCount
in interface Part
- Throws:
MessagingException
getContentType
public java.lang.String getContentType()
throws MessagingException
- Specified by:
getContentType
in interface Part
- Throws:
MessagingException
isMimeType
public boolean isMimeType(java.lang.String type)
throws MessagingException
- Specified by:
isMimeType
in interface Part
- Throws:
MessagingException
getDisposition
public java.lang.String getDisposition()
throws MessagingException
- Specified by:
getDisposition
in interface Part
- Throws:
MessagingException
setDisposition
public void setDisposition(java.lang.String disposition)
throws MessagingException
- Specified by:
setDisposition
in interface Part
- Throws:
MessagingException
getEncoding
public java.lang.String getEncoding()
throws MessagingException
- Specified by:
getEncoding
in interface MimePart
- Throws:
MessagingException
getContentID
public java.lang.String getContentID()
throws MessagingException
- Specified by:
getContentID
in interface MimePart
- Throws:
MessagingException
setContentID
public void setContentID(java.lang.String cid)
throws MessagingException
- Throws:
MessagingException
getContentMD5
public java.lang.String getContentMD5()
throws MessagingException
- Specified by:
getContentMD5
in interface MimePart
- Throws:
MessagingException
setContentMD5
public void setContentMD5(java.lang.String md5)
throws MessagingException
- Specified by:
setContentMD5
in interface MimePart
- Throws:
MessagingException
getContentLanguage
public java.lang.String[] getContentLanguage()
throws MessagingException
- Specified by:
getContentLanguage
in interface MimePart
- Throws:
MessagingException
setContentLanguage
public void setContentLanguage(java.lang.String[] languages)
throws MessagingException
- Specified by:
setContentLanguage
in interface MimePart
- Throws:
MessagingException
getDescription
public java.lang.String getDescription()
throws MessagingException
- Specified by:
getDescription
in interface Part
- Throws:
MessagingException
setDescription
public void setDescription(java.lang.String description)
throws MessagingException
- Specified by:
setDescription
in interface Part
- Throws:
MessagingException
setDescription
public void setDescription(java.lang.String description,
java.lang.String charset)
throws MessagingException
- Throws:
MessagingException
getFileName
public java.lang.String getFileName()
throws MessagingException
- Specified by:
getFileName
in interface Part
- Throws:
MessagingException
setFileName
public void setFileName(java.lang.String name)
throws MessagingException
- Specified by:
setFileName
in interface Part
- Throws:
MessagingException
getInputStream
public java.io.InputStream getInputStream()
throws MessagingException,
java.io.IOException
- Specified by:
getInputStream
in interface Part
- Throws:
MessagingException
java.io.IOException
getContentStream
protected java.io.InputStream getContentStream()
throws MessagingException
- Throws:
MessagingException
getRawInputStream
public java.io.InputStream getRawInputStream()
throws MessagingException
- Throws:
MessagingException
getDataHandler
public DataHandler getDataHandler()
throws MessagingException
- Specified by:
getDataHandler
in interface Part
- Throws:
MessagingException
getContent
public java.lang.Object getContent()
throws MessagingException,
java.io.IOException
- Specified by:
getContent
in interface Part
- Throws:
MessagingException
java.io.IOException
setDataHandler
public void setDataHandler(DataHandler handler)
throws MessagingException
- Specified by:
setDataHandler
in interface Part
- Throws:
MessagingException
setContent
public void setContent(java.lang.Object content,
java.lang.String type)
throws MessagingException
- Specified by:
setContent
in interface Part
- Throws:
MessagingException
setText
public void setText(java.lang.String text)
throws MessagingException
- Specified by:
setText
in interface MimePart
- Throws:
MessagingException
setText
public void setText(java.lang.String text,
java.lang.String charset)
throws MessagingException
- Specified by:
setText
in interface MimePart
- Throws:
MessagingException
setContent
public void setContent(Multipart part)
throws MessagingException
- Specified by:
setContent
in interface Part
- Throws:
MessagingException
writeTo
public void writeTo(java.io.OutputStream out)
throws java.io.IOException,
MessagingException
- Specified by:
writeTo
in interface Part
- Throws:
java.io.IOException
MessagingException
getHeader
public java.lang.String[] getHeader(java.lang.String name)
throws MessagingException
- Specified by:
getHeader
in interface Part
- Throws:
MessagingException
getHeader
public java.lang.String getHeader(java.lang.String name,
java.lang.String delimiter)
throws MessagingException
- Specified by:
getHeader
in interface MimePart
- Throws:
MessagingException
setHeader
public void setHeader(java.lang.String name,
java.lang.String value)
throws MessagingException
- Specified by:
setHeader
in interface Part
- Throws:
MessagingException
addHeader
public void addHeader(java.lang.String name,
java.lang.String value)
throws MessagingException
- Specified by:
addHeader
in interface Part
- Throws:
MessagingException
removeHeader
public void removeHeader(java.lang.String name)
throws MessagingException
- Specified by:
removeHeader
in interface Part
- Throws:
MessagingException
getAllHeaders
public java.util.Enumeration getAllHeaders()
throws MessagingException
- Specified by:
getAllHeaders
in interface Part
- Throws:
MessagingException
getMatchingHeaders
public java.util.Enumeration getMatchingHeaders(java.lang.String[] name)
throws MessagingException
- Specified by:
getMatchingHeaders
in interface Part
- Throws:
MessagingException
getNonMatchingHeaders
public java.util.Enumeration getNonMatchingHeaders(java.lang.String[] name)
throws MessagingException
- Specified by:
getNonMatchingHeaders
in interface Part
- Throws:
MessagingException
addHeaderLine
public void addHeaderLine(java.lang.String line)
throws MessagingException
- Specified by:
addHeaderLine
in interface MimePart
- Throws:
MessagingException
getAllHeaderLines
public java.util.Enumeration getAllHeaderLines()
throws MessagingException
- Specified by:
getAllHeaderLines
in interface MimePart
- Throws:
MessagingException
getMatchingHeaderLines
public java.util.Enumeration getMatchingHeaderLines(java.lang.String[] names)
throws MessagingException
- Specified by:
getMatchingHeaderLines
in interface MimePart
- Throws:
MessagingException
getNonMatchingHeaderLines
public java.util.Enumeration getNonMatchingHeaderLines(java.lang.String[] names)
throws MessagingException
- Specified by:
getNonMatchingHeaderLines
in interface MimePart
- Throws:
MessagingException
updateHeaders
protected void updateHeaders()
throws MessagingException
- Throws:
MessagingException
getSingleHeader
private java.lang.String getSingleHeader(java.lang.String name)
throws MessagingException
- Throws:
MessagingException