gnu.mail.providers.imap

Class IMAPBodyPart

Implemented Interfaces:
IMAPConstants, MimePart, Part

public class IMAPBodyPart
extends MimeBodyPart
implements IMAPConstants

A MIME body part of an IMAP multipart message.

Field Summary

protected int
lines
The number of text lines of this part's content.
protected IMAPMessage
message
The message this part belongs to.
protected String
section
The section used to refer to this part.
protected int
size
The size of this part's content in bytes.

Fields inherited from class javax.mail.internet.MimeBodyPart

content, contentStream, dh, headers

Fields inherited from class javax.mail.BodyPart

parent

Fields inherited from interface javax.mail.Part

ATTACHMENT, INLINE

Constructor Summary

IMAPBodyPart(IMAPMessage message, IMAPMultipart parent, String section, InternetHeaders headers, int size, int lines)
Called by the IMAPMessage.

Method Summary

Object
getContent()
protected InputStream
getContentStream()
Returns the raw content stream.
DataHandler
getDataHandler()
Returns a data handler for this part's content.
int
getLineCount()
Returns the number of text lines in the content of this body part.
int
getSize()
Returns the content size of this body part in bytes.

Methods inherited from class javax.mail.internet.MimeBodyPart

addHeader, addHeaderLine, getAllHeaderLines, getAllHeaders, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getSize, isMimeType, removeHeader, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setHeader, setText, setText, updateHeaders, writeTo

Methods inherited from class javax.mail.BodyPart

getParent

Field Details

lines

protected int lines
The number of text lines of this part's content.


message

protected IMAPMessage message
The message this part belongs to.


section

protected String section
The section used to refer to this part.


size

protected int size
The size of this part's content in bytes.

Constructor Details

IMAPBodyPart

protected IMAPBodyPart(IMAPMessage message,
                       IMAPMultipart parent,
                       String section,
                       InternetHeaders headers,
                       int size,
                       int lines)
            throws MessagingException
Called by the IMAPMessage.

Method Details

getContent

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


getContentStream

protected InputStream getContentStream()
            throws MessagingException
Returns the raw content stream.
Overrides:
getContentStream in interface MimeBodyPart


getDataHandler

public DataHandler getDataHandler()
            throws MessagingException
Returns a data handler for this part's content.
Specified by:
getDataHandler in interface Part
Overrides:
getDataHandler in interface MimeBodyPart


getLineCount

public int getLineCount()
            throws MessagingException
Returns the number of text lines in the content of this body part.
Specified by:
getLineCount in interface Part
Overrides:
getLineCount in interface MimeBodyPart


getSize

public int getSize()
            throws MessagingException
Returns the content size of this body part in bytes.
Specified by:
getSize in interface Part
Overrides:
getSize in interface MimeBodyPart