Package com.xpn.xwiki.store
Class VoidAttachmentVersioningStore
- java.lang.Object
-
- com.xpn.xwiki.store.VoidAttachmentVersioningStore
-
- All Implemented Interfaces:
AttachmentVersioningStore
@Component @Named("void") @Singleton public class VoidAttachmentVersioningStore extends Object implements AttachmentVersioningStore
Void store for attachment versioning when it is disabled. ("xwiki.store.attachment.versioning=0" parameter is set in xwiki.cfg) It says what there is only one version of attachment - latest. It doesn't store anything. It is safe to use with any stores.- Since:
- 1.4M2
- Version:
- $Id: 971adb2818c92d15f1b50f8d580b686e4f60e6c4 $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VoidAttachmentVersioningStore.VoidAttachmentArchive
Void realization of AttachmentArchive.
-
Constructor Summary
Constructors Constructor Description VoidAttachmentVersioningStore()
Empty constructor needed for component manager.VoidAttachmentVersioningStore(XWikiContext context)
Deprecated.1.6M1.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteArchive(XWikiAttachment attachment, XWikiContext context, boolean transaction)
Permanently delete attachment archive.String
getHint()
XWikiAttachmentArchive
loadArchive(XWikiAttachment attachment, XWikiContext context, boolean transaction)
Load attachment archive from store.void
saveArchive(XWikiAttachmentArchive archive, XWikiContext context, boolean transaction)
Save or update attachment archive.
-
-
-
Constructor Detail
-
VoidAttachmentVersioningStore
@Deprecated public VoidAttachmentVersioningStore(XWikiContext context)
Deprecated.1.6M1. Use ComponentManager.lookup(AttachmentVersioningStore.class) instead.Constructor used byXWiki
during storage initialization.- Parameters:
context
- The current context.
-
VoidAttachmentVersioningStore
public VoidAttachmentVersioningStore()
Empty constructor needed for component manager.
-
-
Method Detail
-
getHint
public String getHint()
- Specified by:
getHint
in interfaceAttachmentVersioningStore
- Returns:
- the role hint of the component
-
deleteArchive
public void deleteArchive(XWikiAttachment attachment, XWikiContext context, boolean transaction) throws XWikiException
Description copied from interface:AttachmentVersioningStore
Permanently delete attachment archive.- Specified by:
deleteArchive
in interfaceAttachmentVersioningStore
- Parameters:
attachment
- The attachment to delete.context
- The current context.transaction
- Should use old transaction (false) or create new (true).- Throws:
XWikiException
- If an error occurs.
-
saveArchive
public void saveArchive(XWikiAttachmentArchive archive, XWikiContext context, boolean transaction) throws XWikiException
Description copied from interface:AttachmentVersioningStore
Save or update attachment archive.- Specified by:
saveArchive
in interfaceAttachmentVersioningStore
- Parameters:
archive
- The attachment archive to save.context
- The current context.transaction
- Should use old transaction (false) or create new (true).- Throws:
XWikiException
- If an error occurs.
-
loadArchive
public XWikiAttachmentArchive loadArchive(XWikiAttachment attachment, XWikiContext context, boolean transaction) throws XWikiException
Description copied from interface:AttachmentVersioningStore
Load attachment archive from store.- Specified by:
loadArchive
in interfaceAttachmentVersioningStore
- Parameters:
attachment
- The attachment of archive.context
- The current context.transaction
- Should use old transaction (false) or create new (true).- Returns:
- attachment archive. not null. return empty archive if it is not exist in store.
- Throws:
XWikiException
- If an error occurs.
-
-