com.goldeninnovations.smp
Class MessagePart

java.lang.Object
  extended by com.goldeninnovations.smp.MessagePart

public class MessagePart
extends Object

Represents a single message part of a multipart message.


Method Summary
 String getAttachmentFilename()
          If this MessagePart is an attachment, returns the name of the attached file.
 String getBody()
          Returns the body of the message part without any parsing or decoding.
 String getContentDescription()
          The value of the Content-Description header.
 String getContentDisposition()
          The value of the Content-Disposition header.
 String getContentTransferEncoding()
          The value of the Content-Transfer-Encoding header.
 String getContentType()
          The value of the Content-Type header.
 String getHeader(String headerName)
          Returns the value of first header found that matches the header name.
 String getMimeVersion()
          The value of the MIME-Version header.
 boolean isAttachment()
          True if this MessagePart is an attached file.
 boolean writeAttachment(OutputStream outputStream)
          Attempts to write the contents of this MessagePart to the specified OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMimeVersion

public String getMimeVersion()
The value of the MIME-Version header.

Returns:
mime version or null

getContentType

public String getContentType()
The value of the Content-Type header.

Returns:
content type or null

getContentTransferEncoding

public String getContentTransferEncoding()
The value of the Content-Transfer-Encoding header.

Returns:
content transfer encoding or null

getContentDisposition

public String getContentDisposition()
The value of the Content-Disposition header.

Returns:
content disposition or null

getContentDescription

public String getContentDescription()
The value of the Content-Description header.

Returns:
content description or null

isAttachment

public boolean isAttachment()
True if this MessagePart is an attached file.

Returns:
true if attachment.

getAttachmentFilename

public String getAttachmentFilename()
If this MessagePart is an attachment, returns the name of the attached file.

Returns:
filename of attachment or null

getBody

public String getBody()
Returns the body of the message part without any parsing or decoding.

Returns:
the body contents of the message part

getHeader

public String getHeader(String headerName)
Returns the value of first header found that matches the header name.

Parameters:
headerName - the name of the header to find.
Returns:
the value of the header.

writeAttachment

public boolean writeAttachment(OutputStream outputStream)
                        throws IOException
Attempts to write the contents of this MessagePart to the specified OutputStream.

The contents will be decoded if appropriate and supported. Current encoding supported include:



Copyright © 2010 Eric Daugherty. All Rights Reserved.