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()
Deprecated.
since 9.0RC1, use
getLongSize() instead |
long |
getId() |
long |
getLongSize() |
String |
getMimeType() |
org.suigeneris.jrcs.rcs.Version |
getRCSVersion() |
AttachmentReference |
getReference() |
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, getAuthorizationManager, getContextualAuthorizationManager, getXWikiContext, hasAccess, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
public Attachment(Document doc, XWikiAttachment attachment, XWikiContext context)
public Document getDocument()
public long getId()
public long getDocId()
@Deprecated public int getFilesize()
getLongSize()
insteadpublic long getLongSize()
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.public AttachmentReference getReference()
Copyright © 2004–2021 XWiki. All rights reserved.