org.apache.james.repository.file
Class FilePersistentStreamRepository

java.lang.Object
  extended by org.apache.james.repository.file.AbstractFileRepository
      extended by org.apache.james.repository.file.FilePersistentStreamRepository
All Implemented Interfaces:
Configurable, LogEnabled, Repository, StreamRepository

public class FilePersistentStreamRepository
extends AbstractFileRepository
implements 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.repository.file.AbstractFileRepository
BYTE_MASK, DEBUG, HEX_DIGITS, m_baseDirectory, m_extension, m_filter, m_name
 
Constructor Summary
FilePersistentStreamRepository()
           
 
Method Summary
 InputStream get(String key)
           
protected  String getExtensionDecorator()
           
 long getSize(String key)
          Return the size of the file which belongs to the given key
 OutputStream put(String key)
           
 
Methods inherited from class org.apache.james.repository.file.AbstractFileRepository
configure, containsKey, createChildRepository, decode, encode, getChildRepository, getFile, getInputStream, getLogger, getOutputStream, init, list, remove, setDestination, setFileSystem, setLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.james.repository.api.StreamRepository
list, remove
 
Methods inherited from interface org.apache.james.repository.api.Repository
getChildRepository
 

Constructor Detail

FilePersistentStreamRepository

public FilePersistentStreamRepository()
Method Detail

getExtensionDecorator

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

get

public InputStream get(String key)
Specified by:
get in interface StreamRepository
See Also:
StreamRepository.get(java.lang.String)

put

public OutputStream put(String key)
Specified by:
put in interface StreamRepository
See Also:
StreamRepository.put(java.lang.String)

getSize

public long getSize(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-2012 The Apache Software Foundation. All Rights Reserved.