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 Object
clone()
byte[]
getArchive(XWikiContext context)
Get the archive, loading it from the database if necessary.XWikiAttachment
getRevision(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()
void
setArchive(byte[] data)
Set the archive from a byte array representation of a JRCS archive.void
setRCSArchive(org.suigeneris.jrcs.rcs.Archive archive)
void
updateArchive(byte[] data, XWikiContext context)
Update the archive.void
updateArchive(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 XWikiException
Description copied from class:XWikiAttachmentArchive
Update the archive.- Overrides:
updateArchive
in 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:XWikiAttachmentArchive
Update the archive.- Overrides:
updateArchive
in 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 XWikiException
Description copied from class:XWikiAttachmentArchive
Set the archive from a byte array representation of a JRCS archive.- Overrides:
setArchive
in 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:XWikiAttachmentArchive
Get the archive, loading it from the database if necessary.- Overrides:
getArchive
in 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:
setRCSArchive
in classXWikiAttachmentArchive
- Parameters:
archive
- a JRCS archive.
-
getVersions
public org.suigeneris.jrcs.rcs.Version[] getVersions()
- Overrides:
getVersions
in 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:XWikiAttachmentArchive
Get an old revision of the attachment which this is an archive of.- Overrides:
getRevision
in 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:
clone
in classXWikiAttachmentArchive
-
-