public class CachingAttachmentProvider extends Object implements AttachmentProvider
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTCACHE_NAME
Name of the attachment cache.
|
static String |
ATTCOLLCACHE_NAME
Name of the attachment cache.
|
static String |
DIR_EXTENSION
The extension to append to directory names to denote an attachment directory.
|
static int |
m_capacity
Default cache capacity for now.
|
PROP_STORAGEDIRLATEST_VERSION| Constructor and Description |
|---|
CachingAttachmentProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteAttachment(Attachment att) |
void |
deleteVersion(Attachment att) |
Collection<Attachment> |
findAttachments(QueryItem[] query) |
InputStream |
getAttachmentData(Attachment att) |
Attachment |
getAttachmentInfo(Page page,
String name,
int version) |
String |
getProviderInfo()
Gets the provider class name, and cache statistics (misscount and,hitcount of the attachment cache).
|
AttachmentProvider |
getRealProvider()
Returns the WikiAttachmentProvider that this caching provider delegates to.
|
List<Attachment> |
getVersionHistory(Attachment att) |
void |
initialize(Engine engine,
Properties properties) |
List<Attachment> |
listAllChanged(Date timestamp) |
List<Attachment> |
listAttachments(Page page) |
void |
moveAttachmentsForPage(String oldParent,
String newParent) |
void |
putAttachmentData(Attachment att,
InputStream data) |
public static final int m_capacity
public static final String ATTCACHE_NAME
public static final String ATTCOLLCACHE_NAME
public static final String DIR_EXTENSION
public CachingAttachmentProvider()
public void initialize(Engine engine, Properties properties) throws NoRequiredPropertyException, IOException
initialize in interface WikiProviderNoRequiredPropertyExceptionIOExceptionpublic void putAttachmentData(Attachment att, InputStream data) throws ProviderException, IOException
putAttachmentData in interface AttachmentProviderProviderExceptionIOExceptionpublic InputStream getAttachmentData(Attachment att) throws ProviderException, IOException
getAttachmentData in interface AttachmentProviderProviderExceptionIOExceptionpublic List<Attachment> listAttachments(Page page) throws ProviderException
listAttachments in interface AttachmentProviderProviderExceptionpublic Collection<Attachment> findAttachments(QueryItem[] query)
findAttachments in interface AttachmentProviderpublic List<Attachment> listAllChanged(Date timestamp) throws ProviderException
listAllChanged in interface AttachmentProviderProviderExceptionpublic Attachment getAttachmentInfo(Page page, String name, int version) throws ProviderException
getAttachmentInfo in interface AttachmentProviderProviderExceptionpublic List<Attachment> getVersionHistory(Attachment att)
getVersionHistory in interface AttachmentProviderpublic void deleteVersion(Attachment att) throws ProviderException
deleteVersion in interface AttachmentProviderProviderExceptionpublic void deleteAttachment(Attachment att) throws ProviderException
deleteAttachment in interface AttachmentProviderProviderExceptionpublic String getProviderInfo()
getProviderInfo in interface WikiProviderpublic AttachmentProvider getRealProvider()
public void moveAttachmentsForPage(String oldParent, String newParent) throws ProviderException
moveAttachmentsForPage in interface AttachmentProviderProviderExceptionCopyright © 2001-2020 The Apache Software Foundation. All rights reserved.