com.atlassian.confluence.it
Class Attachment

java.lang.Object
  extended by com.atlassian.confluence.it.Attachment
All Implemented Interfaces:
LinkableContent, TitledContent

public class Attachment
extends Object
implements TitledContent, LinkableContent


Field Summary
static String GIF_TYPE
           
static String MOV_TYPE
           
static String PDF_TYPE
           
static String PNG_TYPE
           
static String SWF_TYPE
           
static String TEXT_TYPE
           
 
Constructor Summary
Attachment(Attachment original, String versionComment, byte[] newData)
           
Attachment(ContentEntity contentEntity, Attachment other)
          Copy constructor -- put the provided attachment on another page.
Attachment(ContentEntity contentEntity, File file, String contentType)
           
Attachment(ContentEntity contentEntity, String filename, String contentType, String classpathResource)
           
Attachment(ContentEntity contentEntity, String filename, String contentType, String comment, byte[] data)
          Creates an Attachment object of an intended file.
 
Method Summary
 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()
           
 UrlBuilder getUrlBuilder()
           
 void setId(long id)
           
 void setUrl(String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GIF_TYPE

public static final String GIF_TYPE
See Also:
Constant Field Values

PNG_TYPE

public static final String PNG_TYPE
See Also:
Constant Field Values

PDF_TYPE

public static final String PDF_TYPE
See Also:
Constant Field Values

TEXT_TYPE

public static final String TEXT_TYPE
See Also:
Constant Field Values

SWF_TYPE

public static final String SWF_TYPE
See Also:
Constant Field Values

MOV_TYPE

public static final String MOV_TYPE
See Also:
Constant Field Values
Constructor Detail

Attachment

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

Attachment

public Attachment(Attachment original,
                  String versionComment,
                  byte[] newData)

Attachment

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

Attachment

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

Attachment

public Attachment(ContentEntity contentEntity,
                  Attachment other)
Copy constructor -- put the provided attachment on another page.

Method Detail

getPage

public ContentEntity getPage()

getFilename

public String getFilename()

getContentType

public String getContentType()

getComment

public String getComment()

getId

public long getId()

setId

public void setId(long id)

setUrl

public void setUrl(String url)

getData

public byte[] getData()

getDownloadUrl

public String getDownloadUrl()

getDownloadUrl

public String getDownloadUrl(String contextPath)
The application context without any slashes at all. Eg "confluence"


getThumbnailUrl

public String getThumbnailUrl()

getEditUrl

public String getEditUrl()

getImageMarkup

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


getAbsoluteImageMarkup

public String getAbsoluteImageMarkup()
Retrieves the wiki markup to embed this image from another page in another space.


getThumbnailMarkup

public String getThumbnailMarkup()

getTitle

public String getTitle()
Specified by:
getTitle in interface TitledContent

getUrl

public String getUrl()
Specified by:
getUrl in interface LinkableContent

getUrlBuilder

public UrlBuilder getUrlBuilder()
Specified by:
getUrlBuilder in interface LinkableContent

getPlaceholderXpath

public String getPlaceholderXpath()
Returns xpath that will match the "unidentified attachment" placeholder for this image.


getImageXpath

public String getImageXpath()
Returns xpath that will match the an embedded image.



Copyright © 2003-2012 Atlassian. All Rights Reserved.