com.atlassian.confluence.it
Class Attachment

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

public class Attachment
extends Object
implements TitledContent, LinkableContent, ContentConvertible, VersionedContent


Nested Class Summary
static class Attachment.AttachmentBuilder
          Builds an Attachment object
 
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
           
static String ZIP_TYPE
           
 
Constructor Summary
Attachment(Attachment original, String versionComment, byte[] newData)
          Deprecated. Since 5.7. Use instead
Attachment(ContentEntity contentEntity, Attachment other)
          Deprecated. Since 5.7. Use instead
Attachment(ContentEntity contentEntity, File file, String contentType)
          Deprecated. Since 5.7. Use instead
Attachment(ContentEntity contentEntity, String filename, String contentType, String classpathResource)
          Deprecated. Since 5.7. Use instead
Attachment(ContentEntity contentEntity, String filename, String contentType, String comment, byte[] data)
          Deprecated. Since 5.7. Use instead
Attachment(ContentEntity contentEntity, String filename, String contentType, String comment, byte[] data, boolean minorEdit)
          Deprecated. Since 5.7. Use instead
 
Method Summary
 String getAbsoluteImageMarkup()
          Retrieves the wiki markup to embed this image from another page in another space.
 String getComment()
           
 ContentId getContentId()
           
 String getContentType()
           
 ContentType getContentTypeObject()
           
 byte[] getData()
           
 String getDownloadUrl()
           
 String getDownloadUrl(String contextPath)
          The application context without any slashes at all.
 String getEditUrl()
           
 String getEditUrl(boolean isFromPageView)
           
 Long getFileId()
           
 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()
           
 int getVersion()
           
 boolean isMinorEdit()
           
 void setFileId(Long fileId)
           
 void setId(long id)
           
 void setUrl(String url)
           
 void setVersion(int version)
           
 boolean shouldConvertToContent()
           
 
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

ZIP_TYPE

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

Attachment

@Deprecated
public Attachment(ContentEntity contentEntity,
                             String filename,
                             String contentType,
                             String comment,
                             byte[] data,
                             boolean minorEdit)
Deprecated. Since 5.7. Use instead

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
minorEdit - whether the attachment is hidden

Attachment

@Deprecated
public Attachment(ContentEntity contentEntity,
                             String filename,
                             String contentType,
                             String comment,
                             byte[] data)
Deprecated. Since 5.7. Use instead


Attachment

@Deprecated
public Attachment(Attachment original,
                             String versionComment,
                             byte[] newData)
Deprecated. Since 5.7. Use instead


Attachment

@Deprecated
public Attachment(ContentEntity contentEntity,
                             File file,
                             String contentType)
Deprecated. Since 5.7. Use instead


Attachment

@Deprecated
public Attachment(ContentEntity contentEntity,
                             String filename,
                             String contentType,
                             String classpathResource)
Deprecated. Since 5.7. Use instead


Attachment

@Deprecated
public Attachment(ContentEntity contentEntity,
                             Attachment other)
Deprecated. Since 5.7. Use instead

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

Method Detail

getPage

public ContentEntity getPage()

getFilename

public String getFilename()

getContentType

public String getContentType()

getContentTypeObject

public ContentType getContentTypeObject()
Specified by:
getContentTypeObject in interface ContentConvertible
Returns:
the api ContentType that this ContentConvertible converts to

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()

getEditUrl

public String getEditUrl(boolean isFromPageView)

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.


getContentId

public ContentId getContentId()
Specified by:
getContentId in interface ContentConvertible
Returns:
the ContentId identifying this Content-convertible entity.

shouldConvertToContent

public boolean shouldConvertToContent()
Specified by:
shouldConvertToContent in interface ContentConvertible
Returns:
true if the implementer wants to be part of the core API (default value), false otherwise

getVersion

public int getVersion()
Specified by:
getVersion in interface VersionedContent

setVersion

public void setVersion(int version)
Specified by:
setVersion in interface VersionedContent

isMinorEdit

public boolean isMinorEdit()
Specified by:
isMinorEdit in interface VersionedContent

getFileId

public Long getFileId()

setFileId

public void setFileId(Long fileId)


Copyright © 2003–2015 Atlassian. All rights reserved.