All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.ibm.network.mail.base.MimePart

public interface MimePart
The MimePart interface is the common base interface for MimeMessages and MimeBodyParts.

MimePart consists of a set of attributes and a "Content".

Attributes:
An attribute is a name/value pair of strings. Each MimePart has following predefined attributes.

Apart from these, any user defined attributes can be added using addHeader().

Content:

The data type of the "content" is returned by the getContentType() method. The MIME typing system is used to name data types.

The content of a body part is available in various formats:

MimePart provides the putByteStream() method that streams out its content as a byte stream in a form suitable for transmission. Before invoking this method, the content should be encoded by a MIME encoder. This byte stream is an aggregation of the body part attributes and its content's byte stream.

MimeMessage and MimeBodyPart implement the MimePart interface.

Author:
Abdul Majeed Ghadialy
See Also:
MimeMessage, MimeBodyPart

Variable Index

 o ATTACHMENT
 o BASE64
 o INLINE
 o SEVENBIT

Method Index

 o addHeader(String, String)
Adds a new field to the Header of this part.
 o getContent()
Returns the content of this part.
 o getContentType()
Returns the MIME data type of this part.
 o getDisposition()
Returns the Content-Disposition of this part.
 o getEncoding()
Returns the Content-Transfer-Encoding of this part.
 o getFileName()
Returns the file name of this part, if any.
 o getHeader(String)
Returns the header field value for the specified header field key.
 o getInputStream()
Returns an InputStream connected to the content of this part.
 o putByteStream(OutputStream)
Writes the header and encoded data to the OutputStream.
 o setContent(Object, String)
Sets the content and the MIME data type of this part.
 o setDisposition(int)
Sets the Content-Disposition of this part.
 o setEncoding(int)
Sets the Content-Transfer-Encoding of this part.
 o setFileName(String)
Sets the file name of this part.
 o setHeader(String, String)
Sets the header fields of this part.

Variables

 o ATTACHMENT
 public static final int ATTACHMENT
 o INLINE
 public static final int INLINE
 o BASE64
 public static final int BASE64
 o SEVENBIT
 public static final int SEVENBIT

Methods

 o addHeader
 public abstract void addHeader(String name,
                                String value)
Adds a new field to the Header of this part.

Parameters:
name - header field key.
value - header field value.
See Also:
addField
 o getContent
 public abstract Object getContent()
Returns the content of this part.

Returns:
the content of this part.
 o getContentType
 public abstract String getContentType()
Returns the MIME data type of this part.

Returns:
the MIME data type of this part.
 o getDisposition
 public abstract int getDisposition()
Returns the Content-Disposition of this part. The disposition describes how the part should be presented to the user.

Returns:
the Content-Disposition of this part.
 o getEncoding
 public abstract int getEncoding()
Returns the Content-Transfer-Encoding of this part.

Returns:
the Content-Transfer-Encoding of this part.
 o getFileName
 public abstract String getFileName()
Returns the file name of this part, if any.

Returns:
the file name of this part, if any.
 o getHeader
 public abstract String getHeader(String name)
Returns the header field value for the specified header field key.

Parameters:
name - header field key.
Returns:
header field value.
 o getInputStream
 public abstract InputStream getInputStream()
Returns an InputStream connected to the content of this part.

Returns:
InputStream connected to the content of this part.
 o putByteStream
 public abstract void putByteStream(OutputStream os) throws IOException
Writes the header and encoded data to the OutputStream.

Parameters:
os - OutputStream to write header and content of this part.
Throws: IOException
in case an IO error is encountered.
See Also:
putByteStream
 o setContent
 public abstract void setContent(Object content,
                                 String type)
Sets the content and the MIME data type of this part.

Parameters:
content - content to be set this part.
type - MIME data type.
 o setDisposition
 public abstract void setDisposition(int disp)
Sets the Content-Disposition of this part.

Parameters:
disp - Content-Disposition.
 o setEncoding
 public abstract void setEncoding(int encoding)
Sets the Content-Transfer-Encoding of this part.

Parameters:
encoding - Content-Transfer-Encoding.
 o setFileName
 public abstract void setFileName(String fileName)
Sets the file name of this part.

Parameters:
fileName - name of the file.
 o setHeader
 public abstract void setHeader(String name,
                                String value)
Sets the header fields of this part.

Parameters:
hdr - Header to read fields from and set the header fields of this part.

All Packages  Class Hierarchy  This Package  Previous  Next  Index