|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.james.mailrepository.filepair.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 java.lang.String |
HANDLED_URL
|
protected static char[] |
HEX_DIGITS
|
protected java.io.File |
m_baseDirectory
|
protected java.lang.String |
m_destination
|
protected java.lang.String |
m_extension
|
protected java.io.FilenameFilter |
m_filter
|
protected java.lang.String |
m_name
|
protected java.lang.String |
m_path
|
protected org.apache.avalon.framework.service.ServiceManager |
m_serviceManager
|
| Constructor Summary | |
|---|---|
AbstractFileRepository()
|
|
| Method Summary | |
|---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
boolean |
containsKey(java.lang.String key)
Indicates if the given key is associated to a contained object |
protected AbstractFileRepository |
createChildRepository()
Return a new instance of this class |
protected java.lang.String |
decode(java.lang.String filename)
Inverse of encode exept it do not use path. |
protected java.lang.String |
encode(java.lang.String key)
Returns a String that uniquely identifies the object. |
org.apache.avalon.cornerstone.services.store.Repository |
getChildRepository(java.lang.String childName)
|
protected abstract java.lang.String |
getExtensionDecorator()
|
protected java.io.File |
getFile(java.lang.String key)
Return the File Object which belongs to the given key |
protected java.io.InputStream |
getInputStream(java.lang.String key)
Return the InputStream which belongs to the given key |
protected java.io.OutputStream |
getOutputStream(java.lang.String key)
Return the OutputStream which belongs to the given key |
void |
initialize()
|
java.util.Iterator |
list()
Returns the list of used keys. |
void |
remove(java.lang.String key)
Remove the object associated to the given key. |
void |
service(org.apache.avalon.framework.service.ServiceManager serviceManager)
|
protected void |
setDestination(java.lang.String destination)
Set the destination for the repository |
| 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 |
| Field Detail |
|---|
protected static final boolean DEBUG
protected static final java.lang.String HANDLED_URL
protected static final int BYTE_MASK
protected static final char[] HEX_DIGITS
protected java.lang.String m_path
protected java.lang.String m_destination
protected java.lang.String m_extension
protected java.lang.String m_name
protected java.io.FilenameFilter m_filter
protected java.io.File m_baseDirectory
protected org.apache.avalon.framework.service.ServiceManager m_serviceManager
| Constructor Detail |
|---|
public AbstractFileRepository()
| Method Detail |
|---|
protected abstract java.lang.String getExtensionDecorator()
public void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
throws org.apache.avalon.framework.service.ServiceException
service in interface org.apache.avalon.framework.service.Serviceableorg.apache.avalon.framework.service.ServiceExceptionServiceable.service(ServiceManager)
public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
configure in interface org.apache.avalon.framework.configuration.Configurableorg.apache.avalon.framework.configuration.ConfigurationExceptionConfigurable.configure(Configuration)
public void initialize()
throws java.lang.Exception
initialize in interface org.apache.avalon.framework.activity.Initializablejava.lang.ExceptionInitializable.initialize()
protected void setDestination(java.lang.String destination)
throws org.apache.avalon.framework.configuration.ConfigurationException
destination - the destination under which the repository get stored
org.apache.avalon.framework.configuration.ConfigurationException - get thrown on invalid destintion syntax
protected AbstractFileRepository createChildRepository()
throws java.lang.Exception
java.lang.Exception - get thrown if an error is detected while create the new instancepublic org.apache.avalon.cornerstone.services.store.Repository getChildRepository(java.lang.String childName)
getChildRepository in interface org.apache.avalon.cornerstone.services.store.RepositoryRepository.getChildRepository(String)
protected java.io.File getFile(java.lang.String key)
throws java.io.IOException
key - the key for which the File get returned
java.io.IOException - get thrown on IO error
protected java.io.InputStream getInputStream(java.lang.String key)
throws java.io.IOException
key - the key for which the InputStream get returned
java.io.IOException - get thrown on IO error
protected java.io.OutputStream getOutputStream(java.lang.String key)
throws java.io.IOException
key - the key for which the OutputStream get returned
java.io.IOException - get thrown on IO errorpublic void remove(java.lang.String key)
key - the key to removepublic boolean containsKey(java.lang.String key)
key - the key which checked for
public java.util.Iterator list()
protected java.lang.String encode(java.lang.String key)
key - the key for which the Object should be searched
protected java.lang.String decode(java.lang.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 | |||||||||