Package com.xpn.xwiki.store
Class VoidAttachmentVersioningStore.VoidAttachmentArchive
- java.lang.Object
-
- com.xpn.xwiki.doc.XWikiAttachmentArchive
-
- com.xpn.xwiki.store.VoidAttachmentVersioningStore.VoidAttachmentArchive
-
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- VoidAttachmentVersioningStore
public static class VoidAttachmentVersioningStore.VoidAttachmentArchive extends XWikiAttachmentArchive
Void realization of AttachmentArchive. It says what there is only one version of attachment - latest. Class is public because used in super.clone() via getClass().newInstance()
-
-
Constructor Summary
Constructors Constructor Description VoidAttachmentArchive()Default constructor.VoidAttachmentArchive(XWikiAttachment attachment)Helper constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()byte[]getArchive(XWikiContext context)Get the archive, loading it from the database if necessary.XWikiAttachmentgetRevision(XWikiAttachment attachment, String rev, XWikiContext context)Get an old revision of the attachment which this is an archive of.org.suigeneris.jrcs.rcs.Version[]getVersions()voidsetArchive(byte[] data)Set the archive from a byte array representation of a JRCS archive.voidsetRCSArchive(org.suigeneris.jrcs.rcs.Archive archive)voidupdateArchive(byte[] data, XWikiContext context)Update the archive.voidupdateArchive(XWikiContext context)Update the archive.-
Methods inherited from class com.xpn.xwiki.doc.XWikiAttachmentArchive
clone, getArchive, getArchiveAsString, getArchiveAsString, getAttachment, getId, getRCSArchive, setArchive, setAttachment, setId
-
-
-
-
Constructor Detail
-
VoidAttachmentArchive
public VoidAttachmentArchive()
Default constructor. Used in super.clone().
-
VoidAttachmentArchive
public VoidAttachmentArchive(XWikiAttachment attachment)
Helper constructor.- Parameters:
attachment- attachment of this archive
-
-
Method Detail
-
updateArchive
public void updateArchive(byte[] data, XWikiContext context) throws XWikiExceptionDescription copied from class:XWikiAttachmentArchiveUpdate the archive.- Overrides:
updateArchivein classXWikiAttachmentArchive- Parameters:
data- not used for anything, the data is loaded from the attachment included with this archive.context- the XWikiContext for the request used to load the correct attachment content from the database.- Throws:
XWikiException- if anything goes wrong.
-
updateArchive
public void updateArchive(XWikiContext context) throws XWikiException
Description copied from class:XWikiAttachmentArchiveUpdate the archive.- Overrides:
updateArchivein classXWikiAttachmentArchive- Parameters:
context- the XWikiContext for the request used to load the correct attachment content from the database.- Throws:
XWikiException- if anything goes wrong.
-
setArchive
public void setArchive(byte[] data) throws XWikiExceptionDescription copied from class:XWikiAttachmentArchiveSet the archive from a byte array representation of a JRCS archive.- Overrides:
setArchivein classXWikiAttachmentArchive- Parameters:
data- a byte array representation of a JRCS archive.- Throws:
XWikiException- if anything goes wrong.
-
getArchive
public byte[] getArchive(XWikiContext context) throws XWikiException
Description copied from class:XWikiAttachmentArchiveGet the archive, loading it from the database if necessary.- Overrides:
getArchivein classXWikiAttachmentArchive- Parameters:
context- the XWikiContext for the request used to load the correct attachment archive from the database.- Returns:
- a byte array representation of a JRCS archive.
- Throws:
XWikiException- if anything goes wrong.
-
setRCSArchive
public void setRCSArchive(org.suigeneris.jrcs.rcs.Archive archive)
- Overrides:
setRCSArchivein classXWikiAttachmentArchive- Parameters:
archive- a JRCS archive.
-
getVersions
public org.suigeneris.jrcs.rcs.Version[] getVersions()
- Overrides:
getVersionsin classXWikiAttachmentArchive- Returns:
- an array of versions which are available for this attachment, ordered by version number descending.
-
getRevision
public XWikiAttachment getRevision(XWikiAttachment attachment, String rev, XWikiContext context) throws XWikiException
Description copied from class:XWikiAttachmentArchiveGet an old revision of the attachment which this is an archive of.- Overrides:
getRevisionin classXWikiAttachmentArchive- Parameters:
attachment- This attachment will be used to get the document to associate the attachment revision with.rev- a String representation of the version to load.context- the context for the request which needed this revision.- Returns:
- an XWikiAttachment for the given revision.
- Throws:
XWikiException- if any Exception is thrown while getting the revision.
-
clone
public Object clone()
- Overrides:
clonein classXWikiAttachmentArchive
-
-