public class XWikiAttachmentArchive extends Object implements Cloneable
Constructor and Description |
---|
XWikiAttachmentArchive() |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
byte[] |
getArchive()
Get the archive if it is currently stored in RAM.
|
byte[] |
getArchive(XWikiContext context)
Get the archive, loading it from the database if necessary.
|
String |
getArchiveAsString()
Get the archive if it is currently stored in RAM.
|
String |
getArchiveAsString(XWikiContext context)
Get the archive, loading it from the database if necessary.
|
XWikiAttachment |
getAttachment() |
long |
getId() |
org.suigeneris.jrcs.rcs.Archive |
getRCSArchive()
Deprecated.
since 2.6M1 please do not use this, it is bound to a jrcs based implementation.
|
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 |
setArchive(String data)
Set the archive from a byte array representation of a JRCS archive.
|
void |
setAttachment(XWikiAttachment attachment)
Set the attachment to associate with this archive.
|
void |
setId(long id)
This does nothing and is only here to satisfy Hibernate.
|
void |
setRCSArchive(org.suigeneris.jrcs.rcs.Archive archive)
Deprecated.
since 2.6M1 please do not use this, it is bound to a jrcs based implementation.
|
void |
updateArchive(byte[] data,
XWikiContext context)
Deprecated.
since 7.1M1, use
updateArchive(XWikiContext) instead |
void |
updateArchive(XWikiContext context)
Update the archive.
|
public long getId()
public void setId(long id)
id
- the id of the attachment which this archive is associated with, unused.@Deprecated public org.suigeneris.jrcs.rcs.Archive getRCSArchive()
@Deprecated public void setRCSArchive(org.suigeneris.jrcs.rcs.Archive archive)
archive
- a JRCS archive.public String getArchiveAsString() throws XWikiException
XWikiException
- if anything goes wrong.public String getArchiveAsString(XWikiContext context) throws XWikiException
context
- the XWikiContext for the request used to load the correct attachment archive from the database.XWikiException
- if anything goes wrong.public byte[] getArchive() throws XWikiException
XWikiException
- if anything goes wrong.public byte[] getArchive(XWikiContext context) throws XWikiException
context
- the XWikiContext for the request used to load the correct attachment archive from the database.XWikiException
- if anything goes wrong.public void setArchive(byte[] data) throws XWikiException
data
- a byte array representation of a JRCS archive.XWikiException
- if anything goes wrong.public void setArchive(String data) throws XWikiException
data
- a String representation of a JRCS archive.XWikiException
- if anything goes wrong.@Deprecated public void updateArchive(byte[] data, XWikiContext context) throws XWikiException
updateArchive(XWikiContext)
insteaddata
- 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.XWikiException
- if anything goes wrong.public void updateArchive(XWikiContext context) throws XWikiException
context
- the XWikiContext for the request used to load the correct attachment content from the database.XWikiException
- if anything goes wrong.public XWikiAttachment getAttachment()
public void setAttachment(XWikiAttachment attachment)
attachment
- the attachment to set for this archive.public org.suigeneris.jrcs.rcs.Version[] getVersions()
public XWikiAttachment getRevision(XWikiAttachment attachment, String rev, XWikiContext context) throws XWikiException
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.XWikiException
- if any Exception is thrown while getting the revision.Copyright © 2004–2022 XWiki. All rights reserved.