|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.doc.XWikiAttachment
public class XWikiAttachment
Constructor Summary | |
---|---|
XWikiAttachment()
|
|
XWikiAttachment(XWikiDocument doc,
String filename)
|
Method Summary | |
---|---|
Object |
clone()
|
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)
Retrive 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 |
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)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XWikiAttachment(XWikiDocument doc, String filename)
public XWikiAttachment()
Method Detail |
---|
public AttachmentReference getReference()
public long getId()
public void setDocId(long id)
public long getDocId()
public void setId(long id)
public Object clone()
clone
in class Object
public int getFilesize()
public void setFilesize(int filesize)
filesize
- in bytepublic int getContentSize(XWikiContext context) throws XWikiException
context
- current XWikiContext
XWikiException
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 XWikiContext
XWikiException
- 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 content
XWikiException
- 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 XWikiContext
IOException
- when an error occurs during streaming operation
XWikiException
- 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 XWikiContext
Element
containing an XML representation of the attachment
XWikiException
- 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)
instead
context
- current XWikiContext
XWikiException
- when an error occurs during wiki operationpublic InputStream getContentInputStream(XWikiContext context) throws XWikiException
context
- current XWikiContext
XWikiException
- 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)
instead
data
- 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 read
IOException
- when an error occurs during streaming operationpublic void setContent(InputStream is) throws IOException
is
- the input stream that will be read
IOException
- 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |