public class Attachment extends Api
Constructor and Description |
---|
Attachment(Document doc,
XWikiAttachment attachment,
XWikiContext context) |
Modifier and Type | Method and Description |
---|---|
XWikiAttachment |
getAttachment() |
Attachment |
getAttachmentRevision(String rev)
Allow to easily access any revision of an attachment.
|
String |
getAuthor() |
String |
getComment() |
byte[] |
getContent() |
byte[] |
getContentAsBytes() |
String |
getContentAsString() |
String |
getContentAsString(String charset) |
InputStream |
getContentInputStream() |
Date |
getDate() |
long |
getDocId() |
Document |
getDocument() |
String |
getFilename() |
int |
getFilesize() |
long |
getId() |
String |
getMimeType() |
org.suigeneris.jrcs.rcs.Version |
getRCSVersion() |
String |
getVersion() |
List<org.suigeneris.jrcs.rcs.Version> |
getVersionList()
Get a list of attachment versions from 1.1 to the current.
|
org.suigeneris.jrcs.rcs.Version[] |
getVersions()
Get an array containing the versions of the attachment.
|
boolean |
isImage() |
convert, convert, convert, convertAttachments, getXWikiContext, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
public Attachment(Document doc, XWikiAttachment attachment, XWikiContext context)
public Document getDocument()
public long getId()
public long getDocId()
public int getFilesize()
public String getFilename()
public String getAuthor()
public String getVersion()
public org.suigeneris.jrcs.rcs.Version getRCSVersion()
public String getComment()
public Date getDate()
public byte[] getContent() throws XWikiException
XWikiException
public byte[] getContentAsBytes() throws XWikiException
XWikiException
public InputStream getContentInputStream()
public String getContentAsString() throws XWikiException
XWikiException
public String getContentAsString(String charset) throws XWikiException
XWikiException
public org.suigeneris.jrcs.rcs.Version[] getVersions() throws XWikiException
getVersionList()
.
WARNING: If there is an error loading content from the database, a single element array will
be returned containing only the current version of the attachment.
Consider using getVersionList()
instead.XWikiException
- this will never happen.public List<org.suigeneris.jrcs.rcs.Version> getVersionList() throws XWikiException
XWikiException
- this will never happen.public XWikiAttachment getAttachment()
XWikiAttachment
public String getMimeType()
public boolean isImage()
public Attachment getAttachmentRevision(String rev) throws XWikiException
rev
- Version to access, in the "Major.minor" format.XWikiException
- In case of an error.Copyright © 2004–2015 XWiki. All rights reserved.