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 java.lang.Object
implements TitledContent, LinkableContent


Field Summary
static java.lang.String GIF_TYPE
           
static java.lang.String MOV_TYPE
           
static java.lang.String PDF_TYPE
           
static java.lang.String PNG_TYPE
           
static java.lang.String SWF_TYPE
           
static java.lang.String TEXT_TYPE
           
 
Constructor Summary
Attachment(Attachment original, java.lang.String versionComment, byte[] newData)
           
Attachment(ContentEntity contentEntity, Attachment other)
          Copy constructor -- put the provided attachment on another page.
Attachment(ContentEntity contentEntity, java.io.File file, java.lang.String contentType)
           
Attachment(ContentEntity contentEntity, java.lang.String filename, java.lang.String contentType, java.lang.String classpathResource)
           
Attachment(ContentEntity contentEntity, java.lang.String filename, java.lang.String contentType, java.lang.String comment, byte[] data)
          Creates an Attachment object of an intended file.
 
Method Summary
 java.lang.String getAbsoluteImageMarkup()
          Retrieves the wiki markup to embed this image from another page in another space.
 java.lang.String getComment()
           
 java.lang.String getContentType()
           
 byte[] getData()
           
 java.lang.String getDownloadUrl()
           
 java.lang.String getDownloadUrl(java.lang.String contextPath)
          The application context without any slashes at all.
 java.lang.String getEditUrl()
           
 java.lang.String getEditUrl(boolean isFromPageView)
           
 java.lang.String getFilename()
           
 long getId()
           
 java.lang.String getImageMarkup()
          Gets the wiki markup to insert this attachment, as an embedded imaged, on the page to which it's attached.
 java.lang.String getImageXpath()
          Returns xpath that will match the an embedded image.
 ContentEntity getPage()
           
 java.lang.String getPlaceholderXpath()
          Returns xpath that will match the "unidentified attachment" placeholder for this image.
 java.lang.String getThumbnailMarkup()
           
 java.lang.String getThumbnailUrl()
           
 java.lang.String getTitle()
           
 java.lang.String getUrl()
           
 UrlBuilder getUrlBuilder()
           
 void setId(long id)
           
 void setUrl(java.lang.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 java.lang.String GIF_TYPE
See Also:
Constant Field Values

PNG_TYPE

public static final java.lang.String PNG_TYPE
See Also:
Constant Field Values

PDF_TYPE

public static final java.lang.String PDF_TYPE
See Also:
Constant Field Values

TEXT_TYPE

public static final java.lang.String TEXT_TYPE
See Also:
Constant Field Values

SWF_TYPE

public static final java.lang.String SWF_TYPE
See Also:
Constant Field Values

MOV_TYPE

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

Attachment

public Attachment(ContentEntity contentEntity,
                  java.lang.String filename,
                  java.lang.String contentType,
                  java.lang.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,
                  java.lang.String versionComment,
                  byte[] newData)

Attachment

public Attachment(ContentEntity contentEntity,
                  java.io.File file,
                  java.lang.String contentType)

Attachment

public Attachment(ContentEntity contentEntity,
                  java.lang.String filename,
                  java.lang.String contentType,
                  java.lang.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 java.lang.String getFilename()

getContentType

public java.lang.String getContentType()

getComment

public java.lang.String getComment()

getId

public long getId()

setId

public void setId(long id)

setUrl

public void setUrl(java.lang.String url)

getData

public byte[] getData()

getDownloadUrl

public java.lang.String getDownloadUrl()

getDownloadUrl

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


getThumbnailUrl

public java.lang.String getThumbnailUrl()

getEditUrl

public java.lang.String getEditUrl()

getEditUrl

public java.lang.String getEditUrl(boolean isFromPageView)

getImageMarkup

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


getAbsoluteImageMarkup

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


getThumbnailMarkup

public java.lang.String getThumbnailMarkup()

getTitle

public java.lang.String getTitle()
Specified by:
getTitle in interface TitledContent

getUrl

public java.lang.String getUrl()
Specified by:
getUrl in interface LinkableContent

getUrlBuilder

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

getPlaceholderXpath

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


getImageXpath

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



Copyright © 2003-2014 Atlassian. All Rights Reserved.