Sun Adapter for e-Mail API

com.stc.connector.emailadapter.appconn
Class EmailAttachment

java.lang.Object
  extended by com.stc.connector.emailadapter.appconn.EmailAttachment
All Implemented Interfaces:
com.stc.connector.persistence.bpel.PersistableData

public class EmailAttachment
extends java.lang.Object
implements com.stc.connector.persistence.bpel.PersistableData

This class implements the email attachment.

Version:
$Version$
Author:
$Author: chuang $

Constructor Summary
EmailAttachment()
          Creates new EmailAttachment.
 
Method Summary
 byte[] getContent()
          Gets the attachment content.
 java.lang.String getContentType()
          Gets the attachment content type (MIME).
 java.lang.String getName()
          Gets the attachment name (filename).
 void persist(com.stc.connector.persistence.bpel.DataOutput dout)
          Persists (serialize) this message.
protected  void readFrom(java.io.InputStream is)
          Reads the attachment file from the InputStream is and stores its content into internal buffer provided by the ByteArrayOutputStream bas.
 void restore(com.stc.connector.persistence.bpel.DataInput din)
          Restore (deserialize) this message.
protected  java.lang.String retrieveContentType()
          Get the content type based on the attributes set.
 void setContent(byte[] content)
          Sets the attachment content.
protected  void setContent(java.io.ByteArrayOutputStream bos)
          Set the content type as a ByteArrayOutputStream.
 void setContentType(java.lang.String contentType)
          Sets the attachment content type (MIME).
 void setName(java.lang.String name)
          Sets the attachment name (filename).
 java.lang.String toString()
          Return the information of this EmailAttachment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmailAttachment

public EmailAttachment()
Creates new EmailAttachment.

Method Detail

setContent

public void setContent(byte[] content)
Sets the attachment content.

Parameters:
content - The attachment content as a byte array.

getContent

public byte[] getContent()
Gets the attachment content.

Returns:
The attachment content as a byte array.

setContentType

public void setContentType(java.lang.String contentType)
Sets the attachment content type (MIME).

Parameters:
contentType - The attachment content type (MIME).

getContentType

public java.lang.String getContentType()
Gets the attachment content type (MIME).

Returns:
The attachment content type (MIME).

setName

public void setName(java.lang.String name)
Sets the attachment name (filename).

Parameters:
name - The attachment name (filename).

getName

public java.lang.String getName()
Gets the attachment name (filename).

Returns:
The attachment name (filename).

setContent

protected void setContent(java.io.ByteArrayOutputStream bos)
Set the content type as a ByteArrayOutputStream.

Parameters:
bos - The ByteArrayOutputStream attachment content.

readFrom

protected void readFrom(java.io.InputStream is)
                 throws java.io.IOException
Reads the attachment file from the InputStream is and stores its content into internal buffer provided by the ByteArrayOutputStream bas.

Parameters:
is - The InputStream.
Throws:
java.io.IOException - upon error.

retrieveContentType

protected java.lang.String retrieveContentType()
Get the content type based on the attributes set.


toString

public java.lang.String toString()
Return the information of this EmailAttachment.

Overrides:
toString in class java.lang.Object
Returns:
The String form of this EmailAttachment.

persist

public void persist(com.stc.connector.persistence.bpel.DataOutput dout)
             throws java.lang.Exception
Persists (serialize) this message.

Specified by:
persist in interface com.stc.connector.persistence.bpel.PersistableData
Parameters:
dout - The DataOutput to which the Java Bean message is persisted.
Throws:
java.lang.Exception - upon error.

restore

public void restore(com.stc.connector.persistence.bpel.DataInput din)
             throws java.lang.Exception
Restore (deserialize) this message.

Specified by:
restore in interface com.stc.connector.persistence.bpel.PersistableData
Parameters:
dis - The DataInput from which the Java Bean message is restored.
Throws:
java.lang.Exception - upon error.

Sun Adapter for e-Mail API