public class

Attachment

extends Object
implements LinkableContent TitledContent
java.lang.Object
   ↳ com.atlassian.confluence.it.Attachment

Summary

Constants
String GIF_TYPE
String MOV_TYPE
String PDF_TYPE
String PNG_TYPE
String SWF_TYPE
String TEXT_TYPE
Public Constructors
Attachment(ContentEntity contentEntity, String filename, String contentType, String comment, byte[] data)
Creates an Attachment object of an intended file.
Attachment(ContentEntity contentEntity, File file, String contentType)
Attachment(ContentEntity contentEntity, String filename, String contentType, String classpathResource)
Attachment(ContentEntity contentEntity, Attachment other)
Copy constructor -- put the provided attachment on another page.
Public Methods
String getAbsoluteImageMarkup()
Retrieves the wiki markup to embed this image from another page in another space.
String getComment()
String getContentType()
byte[] getData()
String getDownloadUrl()
String getDownloadUrl(String contextPath)
The application context without any slashes at all.
String getEditUrl()
String getFilename()
long getId()
String getImageMarkup()
Gets the wiki markup to insert this attachment, as an embedded imaged, on the page to which it's attached.
String getImageXpath()
Returns xpath that will match the an embedded image.
ContentEntity getPage()
String getPlaceholderXpath()
Returns xpath that will match the "unidentified attachment" placeholder for this image.
String getThumbnailMarkup()
String getThumbnailUrl()
String getTitle()
String getUrl()
void setId(long id)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.it.LinkableContent
From interface com.atlassian.confluence.it.TitledContent

Constants

public static final String GIF_TYPE

Constant Value: "image/gif"

public static final String MOV_TYPE

Constant Value: "video/quicktime"

public static final String PDF_TYPE

Constant Value: "application/pdf"

public static final String PNG_TYPE

Constant Value: "image/png"

public static final String SWF_TYPE

Constant Value: "application/x-shockwave-flash"

public static final String TEXT_TYPE

Constant Value: "text/plain"

Public Constructors

public Attachment (ContentEntity contentEntity, String filename, String contentType, String comment, byte[] data)

Creates an Attachment object of an intended file.

 Example:

     Attachment attachment = new Attachment(TEST_PAGE, attachmentName, Attachment.TEXT_TYPE, "your upload comment", "foo".getBytes());
 
Parameters
contentEntity the page or blog where the attachment will reside
filename the attachment file
contentType mime type of the attachment
comment comment associated with the attachment, which can be null
data byte array of the attachment content

public Attachment (ContentEntity contentEntity, File file, String contentType)

public Attachment (ContentEntity contentEntity, String filename, String contentType, String classpathResource)

public Attachment (ContentEntity contentEntity, Attachment other)

Copy constructor -- put the provided attachment on another page.

Public Methods

public String getAbsoluteImageMarkup ()

Retrieves the wiki markup to embed this image from another page in another space.

public String getComment ()

public String getContentType ()

public byte[] getData ()

public String getDownloadUrl ()

public String getDownloadUrl (String contextPath)

The application context without any slashes at all. Eg "confluence"

public String getEditUrl ()

public String getFilename ()

public long getId ()

public String getImageMarkup ()

Gets the wiki markup to insert this attachment, as an embedded imaged, on the page to which it's attached.

public String getImageXpath ()

Returns xpath that will match the an embedded image.

public ContentEntity getPage ()

public String getPlaceholderXpath ()

Returns xpath that will match the "unidentified attachment" placeholder for this image.

public String getThumbnailMarkup ()

public String getThumbnailUrl ()

public String getTitle ()

public String getUrl ()

public void setId (long id)