org.apache.james.core
Class MimeMessageSource

java.lang.Object
  extended by org.apache.james.core.MimeMessageSource
Direct Known Subclasses:
MimeMessageAvalonSource, MimeMessageInputStreamSource, MimeMessageJDBCSource

public abstract class MimeMessageSource
extends java.lang.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  java.io.InputStream getInputStream()
          Get an input stream to retrieve the data stored in the datasource
 long getMessageSize()
          Return the size of all the data.
abstract  java.lang.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 java.lang.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 java.io.InputStream getInputStream()
                                            throws java.io.IOException
Get an input stream to retrieve the data stored in the datasource

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

getMessageSize

public long getMessageSize()
                    throws java.io.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:
java.io.IOException - if an error is encountered while computing the message size


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.