|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.james.repository.file.AbstractFileRepository
public abstract class AbstractFileRepository
This an abstract class implementing functionality for creating a file-store.
| Field Summary | |
|---|---|
protected static int |
BYTE_MASK
|
protected static boolean |
DEBUG
|
protected static char[] |
HEX_DIGITS
|
protected File |
m_baseDirectory
|
protected String |
m_extension
|
protected FilenameFilter |
m_filter
|
protected String |
m_name
|
| Constructor Summary | |
|---|---|
AbstractFileRepository()
|
|
| Method Summary | |
|---|---|
void |
configure(org.apache.commons.configuration.HierarchicalConfiguration configuration)
|
boolean |
containsKey(String key)
Indicates if the given key is associated to a contained object |
protected AbstractFileRepository |
createChildRepository()
Return a new instance of this class |
protected String |
decode(String filename)
Inverse of encode exept it do not use path. |
protected String |
encode(String key)
Returns a String that uniquely identifies the object. |
Repository |
getChildRepository(String childName)
|
protected abstract String |
getExtensionDecorator()
|
protected File |
getFile(String key)
Return the File Object which belongs to the given key |
protected InputStream |
getInputStream(String key)
Return the InputStream which belongs to the given key |
protected org.slf4j.Logger |
getLogger()
|
protected OutputStream |
getOutputStream(String key)
Return the OutputStream which belongs to the given key |
void |
init()
|
Iterator<String> |
list()
Returns the list of used keys. |
void |
remove(String key)
Remove the object associated to the given key. |
protected void |
setDestination(String destination)
Set the destination for the repository |
void |
setFileSystem(FileSystem fileSystem)
|
void |
setLog(org.slf4j.Logger logger)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final boolean DEBUG
protected static final int BYTE_MASK
protected static final char[] HEX_DIGITS
protected String m_extension
protected String m_name
protected FilenameFilter m_filter
protected File m_baseDirectory
| Constructor Detail |
|---|
public AbstractFileRepository()
| Method Detail |
|---|
public void configure(org.apache.commons.configuration.HierarchicalConfiguration configuration)
throws org.apache.commons.configuration.ConfigurationException
configure in interface Configurableorg.apache.commons.configuration.ConfigurationExceptionpublic void setFileSystem(FileSystem fileSystem)
public void setLog(org.slf4j.Logger logger)
setLog in interface LogEnabledprotected org.slf4j.Logger getLogger()
protected abstract String getExtensionDecorator()
@PostConstruct
public void init()
throws Exception
Exception
protected void setDestination(String destination)
throws org.apache.commons.configuration.ConfigurationException
destination - the destination under which the repository get stored
org.apache.commons.configuration.ConfigurationException
org.apache.commons.configuration.ConfigurationException - get thrown on invalid destintion syntax
protected AbstractFileRepository createChildRepository()
throws Exception
Exception - get thrown if an error is detected while create the new
instancepublic Repository getChildRepository(String childName)
getChildRepository in interface RepositoryRepository.getChildRepository(java.lang.String)
protected File getFile(String key)
throws IOException
key - the key for which the File get returned
IOException - get thrown on IO error
protected InputStream getInputStream(String key)
throws IOException
key - the key for which the InputStream get returned
IOException - get thrown on IO error
protected OutputStream getOutputStream(String key)
throws IOException
key - the key for which the OutputStream get returned
IOException - get thrown on IO errorpublic void remove(String key)
key - the key to removepublic boolean containsKey(String key)
key - the key which checked for
public Iterator<String> list()
protected String encode(String key)
key - the key for which the Object should be searched
protected String decode(String filename)
filename - the filename for which the key should generated
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||