org.apache.james.core
Class MimeMessageSource

java.lang.Object
  |
  +--org.apache.james.core.MimeMessageSource
Direct Known Subclasses:
MimeMessageAvalonSource, MimeMessageInputStreamSource, MimeMessageJDBCSource

public abstract class MimeMessageSource
extends Object

This defines a reusable datasource that can supply an input stream with MimeMessage data. This allows a MimeMessageWrapper or other classes to grab the underlying data.

See Also:
MimeMessageWrapper

Constructor Summary
MimeMessageSource()
           
 
Method Summary
abstract  InputStream getInputStream()
          Get an input stream to retrieve the data stored in the datasource
 long getMessageSize()
          Return the size of all the data.
abstract  String getSourceId()
          Returns a unique String ID that represents the location from where this file is loaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeMessageSource

public MimeMessageSource()
Method Detail

getSourceId

public abstract String getSourceId()
Returns a unique String ID that represents the location from where this file is loaded. This will be used to identify where the data is, primarily to avoid situations where this data would get overwritten.

Returns:
the String ID

getInputStream

public abstract InputStream getInputStream()
                                    throws IOException
Get an input stream to retrieve the data stored in the datasource

Returns:
a InputStream containing the data
Throws:
IOException - if an error occurs while generating the InputStream

getMessageSize

public long getMessageSize()
                    throws IOException
Return the size of all the data. Default implementation... others can override to do this much faster

Returns:
the size of the data represented by this source
Throws:
IOException - if an error is encountered while computing the message size


"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."