Jwma

dtw.webmail.util
Class MimeBodyPartDataSource

java.lang.Object
  |
  +--dtw.webmail.util.MimeBodyPartDataSource
All Implemented Interfaces:
javax.activation.DataSource

public class MimeBodyPartDataSource
extends java.lang.Object
implements javax.activation.DataSource

Class that implements a MimeBodyPartDataSource. It implements DataSource for handling with the Mail API (or other JAF aware) classes.

Version:
0.9.7 07/02/2003
Author:
Dieter Wimberger

Constructor Summary
MimeBodyPartDataSource(java.lang.String type, java.lang.String name, byte[] data)
          Constructs a MimeBodyPartDataSource instance.
 
Method Summary
 java.lang.String getContentType()
          Returns the content type of this instance as String.
 java.io.InputStream getInputStream()
          Returns the data of this instance as InputStream.
 java.lang.String getName()
          Returns the name of this instance as String.
 java.io.OutputStream getOutputStream()
          Throws an IOException in this implementation, because this instance represents a read-only DataSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeBodyPartDataSource

public MimeBodyPartDataSource(java.lang.String type,
                              java.lang.String name,
                              byte[] data)
Constructs a MimeBodyPartDataSource instance.

Parameters:
type - the content type of the constructed instance as String.
name - the name of the constructed instance as String.
data - the data of the constructed instance as byte[].
Method Detail

getContentType

public java.lang.String getContentType()
Returns the content type of this instance as String.

(DataSource implementation)

Specified by:
getContentType in interface javax.activation.DataSource
Returns:
the content type as String

getName

public java.lang.String getName()
Returns the name of this instance as String.

(DataSource implementation)

Specified by:
getName in interface javax.activation.DataSource
Returns:
the name as String

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns the data of this instance as InputStream.

(DataSource implementation); wraps the data into a ByteArrayInputStream.

Specified by:
getInputStream in interface javax.activation.DataSource
Returns:
the data of this instance as InputStream.
Throws:
java.io.IOException - if impossible.

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Throws an IOException in this implementation, because this instance represents a read-only DataSource.

(DataSource implementation)

Specified by:
getOutputStream in interface javax.activation.DataSource
Returns:
an OutputStream instance for writing to this DataSource.
Throws:
java.io.IOException - if impossible.

Jwma

Copyright © 2000-2003 jwma team (All Rights Reserved.)