org.abstracthorizon.mercury.imap.util.section
Class Body

java.lang.Object
  extended by org.abstracthorizon.mercury.imap.util.Section
      extended by org.abstracthorizon.mercury.imap.util.section.PointerSection
          extended by org.abstracthorizon.mercury.imap.util.section.Body

public class Body
extends PointerSection

BODY section

Author:
Daniel Sendula

Field Summary
 int from
          From
protected static org.slf4j.Logger logger
          Logger
 boolean peek
          Is this PEEK
 boolean rfc822
          RFC822 keyword
 int to
          To
 
Fields inherited from class org.abstracthorizon.mercury.imap.util.section.PointerSection
child
 
Constructor Summary
Body()
          Constructor
 
Method Summary
protected  long calcSize(javax.mail.Part part)
          Calculates the size of given part
 MeasuredInputStream getInputStream(javax.mail.internet.MimeMessage msg)
          Returns measured input stream of a message
 InputStream getPartsInputStream(javax.mail.Part part)
          Returns input stream of a part
 boolean hasStream()
          Returns true if child exists and child is instance of HeaderSection
protected  void saveChanges(javax.mail.Part part)
          Saves changes of the part
protected  InputStream skipHeaders(InputStream is)
          This method skips over header in the input stream
 String toString()
          String representation of this class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static final org.slf4j.Logger logger
Logger


peek

public boolean peek
Is this PEEK


from

public int from
From


to

public int to
To


rfc822

public boolean rfc822
RFC822 keyword

Constructor Detail

Body

public Body()
Constructor

Method Detail

getInputStream

public MeasuredInputStream getInputStream(javax.mail.internet.MimeMessage msg)
                                   throws IOException,
                                          javax.mail.MessagingException
Returns measured input stream of a message

Parameters:
msg - message
Returns:
measured input stream
Throws:
IOException
javax.mail.MessagingException

getPartsInputStream

public InputStream getPartsInputStream(javax.mail.Part part)
                                throws IOException,
                                       javax.mail.MessagingException
Returns input stream of a part

Parameters:
part - part
Returns:
input stream
Throws:
IOException
javax.mail.MessagingException

saveChanges

protected void saveChanges(javax.mail.Part part)
                    throws javax.mail.MessagingException
Saves changes of the part

Parameters:
part - part
Throws:
javax.mail.MessagingException

hasStream

public boolean hasStream()
Returns true if child exists and child is instance of HeaderSection

Returns:
true if child exists and child is instance of HeaderSection

toString

public String toString()
String representation of this class

Overrides:
toString in class Object
Returns:
string representation of this class

skipHeaders

protected InputStream skipHeaders(InputStream is)
                           throws IOException
This method skips over header in the input stream

Parameters:
is - input stream
Returns:
same input stream
Throws:
IOException

calcSize

protected long calcSize(javax.mail.Part part)
                 throws IOException,
                        javax.mail.MessagingException
Calculates the size of given part

Parameters:
part - part
Returns:
size of given part
Throws:
IOException
javax.mail.MessagingException


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.