org.apache.james.mailrepository
Class MimeMessageAvalonSource

java.lang.Object
  extended by org.apache.james.core.MimeMessageSource
      extended by org.apache.james.mailrepository.MimeMessageAvalonSource

public class MimeMessageAvalonSource
extends MimeMessageSource


Constructor Summary
MimeMessageAvalonSource(org.apache.avalon.cornerstone.services.store.StreamRepository sr, java.lang.String repositoryName, java.lang.String key)
          Main constructor
 
Method Summary
 java.io.InputStream getInputStream()
          Return the InputStream
 long getMessageSize()
          Return the size of all the data.
 java.lang.String getSourceId()
          Returns a unique String ID that represents the location from where this source is loaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeMessageAvalonSource

public MimeMessageAvalonSource(org.apache.avalon.cornerstone.services.store.StreamRepository sr,
                               java.lang.String repositoryName,
                               java.lang.String key)
Main constructor

Parameters:
sr - The stream repository used by this data source.
repositoryName - The name of the repository
key - The key for the particular stream in the stream repository to be used by this data source.
Method Detail

getSourceId

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

Specified by:
getSourceId in class MimeMessageSource
Returns:
the String ID

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Return the InputStream

Specified by:
getInputStream in class MimeMessageSource
Returns:
stream return the InputStream
Throws:
java.io.IOException - if an error occurs while generating the InputStream

getMessageSize

public long getMessageSize()
                    throws java.io.IOException
Description copied from class: MimeMessageSource
Return the size of all the data. Default implementation... others can override to do this much faster

Overrides:
getMessageSize in class MimeMessageSource
Returns:
the size of the data represented by this source
Throws:
java.io.IOException - if an error is encountered while computing the message size
See Also:
MimeMessageSource.getMessageSize()


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.