Constructor and Description |
---|
XWikiAttachment() |
XWikiAttachment(XWikiDocument doc,
String filename) |
Modifier and Type | Method and Description |
---|---|
boolean |
apply(XWikiAttachment attachment)
Apply the provided attachment so that the current one contains the same informations and indicate if it was
necessary to modify it in any way.
|
Object |
clone() |
boolean |
equalsData(XWikiAttachment otherAttachment,
XWikiContext xcontext) |
void |
fromXML(org.dom4j.Element docel) |
void |
fromXML(String data) |
org.suigeneris.jrcs.rcs.Archive |
getArchive()
Deprecated.
since 2.6M1 please do not use this, it is bound to a jrcs based implementation.
|
XWikiAttachmentArchive |
getAttachment_archive() |
XWikiAttachmentContent |
getAttachment_content() |
XWikiAttachment |
getAttachmentRevision(String rev,
XWikiContext context) |
String |
getAuthor() |
String |
getComment() |
byte[] |
getContent(XWikiContext context)
Deprecated.
use
getContentInputStream(XWikiContext) instead |
InputStream |
getContentInputStream(XWikiContext context)
Retrieve the content of this attachment as an input stream.
|
int |
getContentSize(XWikiContext context) |
Date |
getDate() |
XWikiDocument |
getDoc() |
long |
getDocId() |
String |
getFilename() |
int |
getFilesize() |
long |
getId() |
String |
getMimeType(XWikiContext context) |
String |
getNextVersion() |
org.suigeneris.jrcs.rcs.Version |
getRCSVersion() |
AttachmentReference |
getReference() |
String |
getVersion() |
List<org.suigeneris.jrcs.rcs.Version> |
getVersionList()
Get the list of all versions up to the current.
|
org.suigeneris.jrcs.rcs.Version[] |
getVersions() |
void |
incrementVersion() |
boolean |
isContentDirty() |
boolean |
isImage(XWikiContext context) |
boolean |
isMetaDataDirty() |
XWikiAttachmentArchive |
loadArchive(XWikiContext context) |
void |
loadContent(XWikiContext context) |
void |
merge(XWikiAttachment previousAttachment,
XWikiAttachment nextAttachment,
MergeConfiguration configuration,
XWikiContext xcontext,
MergeResult mergeResult) |
void |
setArchive(org.suigeneris.jrcs.rcs.Archive archive)
Deprecated.
since 2.6M1 please do not use this, it is bound to a jrcs based implementation.
|
void |
setArchive(String data) |
void |
setAttachment_archive(XWikiAttachmentArchive attachment_archive) |
void |
setAttachment_content(XWikiAttachmentContent attachment_content) |
void |
setAuthor(String author) |
void |
setComment(String comment) |
void |
setContent(byte[] data)
Deprecated.
use
setContent(java.io.InputStream, int) instead |
void |
setContent(InputStream is)
Set the content of the attachment from an InputStream.
|
void |
setContent(InputStream is,
int length)
Set the content of an attachment from an InputStream.
|
void |
setDate(Date date) |
void |
setDoc(XWikiDocument doc) |
void |
setDocId(long id) |
void |
setFilename(String filename) |
void |
setFilesize(int filesize)
Set cached filesize of the attachment that will be stored as metadata
|
void |
setId(long id) |
void |
setMetaDataDirty(boolean metaDataDirty) |
void |
setRCSVersion(org.suigeneris.jrcs.rcs.Version version) |
void |
setVersion(String version) |
String |
toStringXML(boolean bWithAttachmentContent,
boolean bWithVersions,
XWikiContext context)
Retrieve an attachment as an XML string.
|
org.dom4j.Element |
toXML(boolean bWithAttachmentContent,
boolean bWithVersions,
XWikiContext context)
Retrieve XML representation of attachment's metadata into an
Element . |
void |
toXML(com.xpn.xwiki.internal.xml.XMLWriter wr,
boolean bWithAttachmentContent,
boolean bWithVersions,
XWikiContext context)
Write an XML representation of the attachment into an
XMLWriter |
org.dom4j.Element |
toXML(XWikiContext context)
Retrieve XML representation of attachment's metadata into an
Element . |
void |
updateContentArchive(XWikiContext context) |
public XWikiAttachment(XWikiDocument doc, String filename)
public XWikiAttachment()
public AttachmentReference getReference()
public long getId()
public void setDocId(long id)
public long getDocId()
public void setId(long id)
public int getFilesize()
public void setFilesize(int filesize)
filesize
- in bytepublic int getContentSize(XWikiContext context) throws XWikiException
context
- current XWikiContextXWikiException
public String getFilename()
public void setFilename(String filename)
public String getAuthor()
public void setAuthor(String author)
public String getVersion()
public void setVersion(String version)
public String getNextVersion()
public org.suigeneris.jrcs.rcs.Version getRCSVersion()
public void setRCSVersion(org.suigeneris.jrcs.rcs.Version version)
public String getComment()
public void setComment(String comment)
public XWikiDocument getDoc()
public void setDoc(XWikiDocument doc)
public Date getDate()
public void setDate(Date date)
public boolean isContentDirty()
public void incrementVersion()
public boolean isMetaDataDirty()
public void setMetaDataDirty(boolean metaDataDirty)
public String toStringXML(boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context) throws XWikiException
toXML(com.xpn.xwiki.internal.xml.XMLWriter, boolean, boolean, com.xpn.xwiki.XWikiContext)
to avoid
memory loads when appropriate.bWithAttachmentContent
- if true, binary content of the attachment is included (base64 encoded)bWithVersions
- if true, all archived versions are also includedcontext
- current XWikiContextXWikiException
- when an error occurs during wiki operationspublic org.dom4j.Element toXML(XWikiContext context) throws XWikiException
Element
.Element
containing an XML representation of the attachment without contentXWikiException
- when an error occurs during wiki operationspublic void toXML(com.xpn.xwiki.internal.xml.XMLWriter wr, boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context) throws IOException, XWikiException
XMLWriter
wr
- the XMLWriter to write tobWithAttachmentContent
- if true, binary content of the attachment is included (base64 encoded)bWithVersions
- if true, all archive version is also includedcontext
- current XWikiContextIOException
- when an error occurs during streaming operationXWikiException
- when an error occurs during xwiki operationpublic org.dom4j.Element toXML(boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context) throws XWikiException
Element
. You should prefer
toXML(com.xpn.xwiki.internal.xml.XMLWriter, boolean, boolean, com.xpn.xwiki.XWikiContext)
to avoid
memory loads when appropriate.bWithAttachmentContent
- if true, binary content of the attachment is included (base64 encoded)bWithVersions
- if true, all archived versions are also includedcontext
- current XWikiContextElement
containing an XML representation of the attachmentXWikiException
- when an error occurs during wiki operationspublic void fromXML(String data) throws XWikiException
XWikiException
public void fromXML(org.dom4j.Element docel) throws XWikiException
XWikiException
public XWikiAttachmentContent getAttachment_content()
public void setAttachment_content(XWikiAttachmentContent attachment_content)
public XWikiAttachmentArchive getAttachment_archive()
public void setAttachment_archive(XWikiAttachmentArchive attachment_archive)
@Deprecated public byte[] getContent(XWikiContext context) throws XWikiException
getContentInputStream(XWikiContext)
insteadcontext
- current XWikiContextXWikiException
- when an error occurs during wiki operationpublic InputStream getContentInputStream(XWikiContext context) throws XWikiException
context
- current XWikiContextXWikiException
- when an error occurs during wiki operation@Deprecated public org.suigeneris.jrcs.rcs.Archive getArchive()
@Deprecated public void setArchive(org.suigeneris.jrcs.rcs.Archive archive)
public void setArchive(String data) throws XWikiException
XWikiException
public org.suigeneris.jrcs.rcs.Version[] getVersions()
public List<org.suigeneris.jrcs.rcs.Version> getVersionList() throws XWikiException
XWikiException
- never happens.@Deprecated public void setContent(byte[] data)
setContent(java.io.InputStream, int)
insteaddata
- a byte array with the binary content of the attachmentpublic void setContent(InputStream is, int length) throws IOException
is
- the input stream that will be readlength
- the length in byte to readIOException
- when an error occurs during streaming operationpublic void setContent(InputStream is) throws IOException
is
- the input stream that will be readIOException
- when an error occurs during streaming operationpublic void loadContent(XWikiContext context) throws XWikiException
XWikiException
public XWikiAttachmentArchive loadArchive(XWikiContext context) throws XWikiException
XWikiException
public void updateContentArchive(XWikiContext context) throws XWikiException
XWikiException
public String getMimeType(XWikiContext context)
public boolean isImage(XWikiContext context)
public XWikiAttachment getAttachmentRevision(String rev, XWikiContext context) throws XWikiException
XWikiException
public boolean apply(XWikiAttachment attachment)
attachment
- the attachment to applypublic boolean equalsData(XWikiAttachment otherAttachment, XWikiContext xcontext) throws XWikiException
XWikiException
public void merge(XWikiAttachment previousAttachment, XWikiAttachment nextAttachment, MergeConfiguration configuration, XWikiContext xcontext, MergeResult mergeResult)
Copyright © 2004–2014 XWiki. All rights reserved.