com.xpn.xwiki.api
Class Attachment

java.lang.Object
  extended by com.xpn.xwiki.api.Api
      extended by com.xpn.xwiki.api.Attachment

public class Attachment
extends Api


Field Summary
private  XWikiAttachment attachment
           
private  Document doc
           
 
Fields inherited from class com.xpn.xwiki.api.Api
context
 
Constructor Summary
Attachment(Document doc, XWikiAttachment attachment, XWikiContext context)
           
 
Method Summary
 org.apache.commons.jrcs.rcs.Archive getArchive()
           
 XWikiAttachment getAttachment()
           
 XWikiAttachment getAttachmentRevision(java.lang.String rev)
           
 java.lang.String getAuthor()
           
 java.lang.String getComment()
           
 byte[] getContent()
           
 java.util.Date getDate()
           
 long getDocId()
           
 Document getDocument()
           
 java.lang.String getFilename()
           
 int getFilesize()
           
 long getId()
           
 java.lang.String getMimeType()
           
 org.apache.commons.jrcs.rcs.Version getRCSVersion()
           
 java.lang.String getVersion()
           
 java.util.List getVersionList()
           
 org.apache.commons.jrcs.rcs.Version[] getVersions()
           
 boolean isImage()
           
 
Methods inherited from class com.xpn.xwiki.api.Api
checkProgrammingRights, hasAccessLevel, hasAdminRights, hasProgrammingRights
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doc

private Document doc

attachment

private XWikiAttachment attachment
Constructor Detail

Attachment

public Attachment(Document doc,
                  XWikiAttachment attachment,
                  XWikiContext context)
Method Detail

getDocument

public Document getDocument()
Returns:
the document the file is attached to

getId

public long getId()
Returns:
the document Id of the attachment

getDocId

public long getDocId()
Returns:
the id of the document the file is attached to

getFilesize

public int getFilesize()
Returns:
the Attachment size

getFilename

public java.lang.String getFilename()
Returns:
the attachment name

getAuthor

public java.lang.String getAuthor()
Returns:
the login of the person who attach the file

getVersion

public java.lang.String getVersion()
Returns:
the last version number of the document

getRCSVersion

public org.apache.commons.jrcs.rcs.Version getRCSVersion()
Returns:
the RCS object version of the document

getComment

public java.lang.String getComment()
Returns:
the list of comments

getDate

public java.util.Date getDate()
Returns:
the date of the last uploaded version

getContent

public byte[] getContent()
                  throws XWikiException
Returns:
the content of the attachment
Throws:
XWikiException

getArchive

public org.apache.commons.jrcs.rcs.Archive getArchive()
Returns:
the rcs archive of the attachement

getVersions

public org.apache.commons.jrcs.rcs.Version[] getVersions()
                                                  throws XWikiException
Throws:
XWikiException

getVersionList

public java.util.List getVersionList()
                              throws XWikiException
Returns:
a list of string with all the versions number in String
Throws:
XWikiException

getAttachment

public XWikiAttachment getAttachment()
Returns:
the XWikiAttachment object (without the wrapping) if you have the programming right
See Also:
XWikiAttachment

getMimeType

public java.lang.String getMimeType()
Returns:
the mimetype of the attachment

isImage

public boolean isImage()
Returns:
true if it's an image

getAttachmentRevision

public XWikiAttachment getAttachmentRevision(java.lang.String rev)
                                      throws XWikiException
Throws:
XWikiException


Copyright 2003 Ludovic Dubost