gnu.mail.providers.imap
Class IMAPBodyPart

java.lang.Object
  extended by javax.mail.BodyPart
      extended by javax.mail.internet.MimeBodyPart
          extended by gnu.mail.providers.imap.IMAPBodyPart
All Implemented Interfaces:
MimePart, Part, org.jpackage.mail.inet.imap.IMAPConstants

public class IMAPBodyPart
extends MimeBodyPart
implements org.jpackage.mail.inet.imap.IMAPConstants

A MIME body part of an IMAP multipart message.

Author:
Chris Burdess

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  java.lang.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 org.jpackage.mail.inet.imap.IMAPConstants
ACL, ALERT, APPEND, AUTHENTICATE, BAD, BODY, BODY_PEEK, BODYSTRUCTURE, BYE, CAPABILITY, CHECK, CLOSE, COPY, CRAM_MD5, CREATE, DELETE, DELETEACL, ENVELOPE, EXAMINE, EXISTS, EXPUNGE, FETCH, FETCH_FLAGS, FLAG_ANSWERED, FLAG_DELETED, FLAG_DRAFT, FLAG_FLAGGED, FLAG_RECENT, FLAG_SEEN, FLAGS, GETACL, GETQUOTA, GETQUOTAROOT, GSSAPI, HEADER, HEADER_FIELDS, HEADER_FIELDS_NOT, INTERNALDATE, KERBEROS_V4, LIST, LIST_MARKED, LIST_NOINFERIORS, LIST_NOSELECT, LIST_UNMARKED, LISTRIGHTS, LOGIN, LOGINDISABLED, LOGOUT, LSUB, MESSAGES, MYRIGHTS, NAMESPACE, NEWNAME, NIL, NO, NOOP, OK, PARSE, PERMANENTFLAGS, PREAUTH, QUOTA, QUOTAROOT, READ_ONLY, READ_WRITE, RECENT, RENAME, RFC822, RFC822_HEADER, RFC822_SIZE, RFC822_TEXT, RIGHTS_ADMIN, RIGHTS_CREATE, RIGHTS_DELETE, RIGHTS_INSERT, RIGHTS_LOOKUP, RIGHTS_POST, RIGHTS_READ, RIGHTS_SEEN, RIGHTS_WRITE, SEARCH, SEARCH_ALL, SEARCH_ANSWERED, SEARCH_BCC, SEARCH_BEFORE, SEARCH_BODY, SEARCH_CC, SEARCH_DELETED, SEARCH_DRAFT, SEARCH_FLAGGED, SEARCH_FROM, SEARCH_HEADER, SEARCH_KEYWORD, SEARCH_LARGER, SEARCH_NEW, SEARCH_NOT, SEARCH_OLD, SEARCH_ON, SEARCH_OR, SEARCH_RECENT, SEARCH_SEEN, SEARCH_SENTBEFORE, SEARCH_SENTON, SEARCH_SENTSINCE, SEARCH_SINCE, SEARCH_SMALLER, SEARCH_SUBJECT, SEARCH_TEXT, SEARCH_TO, SEARCH_UID, SEARCH_UNANSWERED, SEARCH_UNDELETED, SEARCH_UNDRAFT, SEARCH_UNFLAGGED, SEARCH_UNKEYWORD, SEARCH_UNSEEN, SELECT, SETACL, SETQUOTA, SKEY, STARTTLS, STATUS, STORAGE, STORE, SUBSCRIBE, TRYCREATE, UID, UIDNEXT, UIDVALIDITY, UNSEEN, UNSUBSCRIBE
 
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
 
Constructor Summary
protected IMAPBodyPart(IMAPMessage message, IMAPMultipart parent, java.lang.String section, InternetHeaders headers, int size, int lines)
          Called by the IMAPMessage.
 
Method Summary
 java.lang.Object getContent()
          Returns this part's content as a Java object.
protected  java.io.InputStream getContentStream()
          Returns the raw content stream.
 javax.activation.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, getContentID, getContentLanguage, getContentMD5, getContentType, getDescription, getDisposition, getEncoding, getFileName, getHeader, getHeader, getInputStream, getMatchingHeaderLines, getMatchingHeaders, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

message

protected IMAPMessage message
The message this part belongs to.


section

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


size

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


lines

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

Constructor Detail

IMAPBodyPart

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

Throws:
MessagingException
Method Detail

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 class MimeBodyPart
Throws:
MessagingException

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 class MimeBodyPart
Throws:
MessagingException

getDataHandler

public javax.activation.DataHandler getDataHandler()
                                            throws MessagingException
Returns a data handler for this part's content.

Specified by:
getDataHandler in interface Part
Overrides:
getDataHandler in class MimeBodyPart
Throws:
MessagingException

getContent

public java.lang.Object getContent()
                            throws MessagingException,
                                   java.io.IOException
Description copied from class: MimeBodyPart
Returns this part's content as a Java object.

Specified by:
getContent in interface Part
Overrides:
getContent in class MimeBodyPart
Throws:
java.io.IOException - if an error occurred in the data handler layer
MessagingException

getContentStream

protected java.io.InputStream getContentStream()
                                        throws MessagingException
Returns the raw content stream.

Overrides:
getContentStream in class MimeBodyPart
Throws:
MessagingException


© Copyright 2003, 2004 The Free Software Foundation, All rights reserved