org.apache.james.mailrepository.filepair
Class File_Persistent_Stream_Repository

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.james.mailrepository.filepair.AbstractFileRepository
          extended by org.apache.james.mailrepository.filepair.File_Persistent_Stream_Repository
All Implemented Interfaces:
org.apache.avalon.cornerstone.services.store.Repository, org.apache.avalon.cornerstone.services.store.StreamRepository, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable

public class File_Persistent_Stream_Repository
extends AbstractFileRepository
implements org.apache.avalon.cornerstone.services.store.StreamRepository

Implementation of a StreamRepository to a File. TODO: -retieve(String key) should return a FilterInputStream to allow mark and reset methods. (working not like BufferedInputStream!!!)


Field Summary
 
Fields inherited from class org.apache.james.mailrepository.filepair.AbstractFileRepository
BYTE_MASK, DEBUG, HANDLED_URL, HEX_DIGITS, m_baseDirectory, m_destination, m_extension, m_filter, m_name, m_path, m_serviceManager
 
Constructor Summary
File_Persistent_Stream_Repository()
           
 
Method Summary
 java.io.InputStream get(java.lang.String key)
          Get the object associated to the given unique key.
protected  java.lang.String getExtensionDecorator()
           
 long getSize(java.lang.String key)
          Return the size of the file which belongs to the given key
 java.io.OutputStream put(java.lang.String key)
          Store the given object and associates it to the given key
 
Methods inherited from class org.apache.james.mailrepository.filepair.AbstractFileRepository
configure, containsKey, createChildRepository, decode, encode, getChildRepository, getFile, getInputStream, getOutputStream, initialize, list, remove, service, setDestination
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.avalon.cornerstone.services.store.StreamRepository
list, remove
 
Methods inherited from interface org.apache.avalon.cornerstone.services.store.Repository
getChildRepository
 

Constructor Detail

File_Persistent_Stream_Repository

public File_Persistent_Stream_Repository()
Method Detail

getExtensionDecorator

protected java.lang.String getExtensionDecorator()
Specified by:
getExtensionDecorator in class AbstractFileRepository
See Also:
AbstractFileRepository.getExtensionDecorator()

get

public java.io.InputStream get(java.lang.String key)
Get the object associated to the given unique key.

Specified by:
get in interface org.apache.avalon.cornerstone.services.store.StreamRepository
See Also:
StreamRepository.get(String)

put

public java.io.OutputStream put(java.lang.String key)
Store the given object and associates it to the given key

Specified by:
put in interface org.apache.avalon.cornerstone.services.store.StreamRepository
See Also:
StreamRepository.put(String)

getSize

public long getSize(java.lang.String key)
Return the size of the file which belongs to the given key

Parameters:
key - the key to get the size for
Returns:
size the Size which belongs to the givens keys file


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