Class AttachmentEntity
- java.lang.Object
-
- com.atlassian.confluence.plugins.rest.entities.SearchResultEntity
-
- com.atlassian.confluence.plugins.rest.entities.AttachmentEntity
-
public class AttachmentEntity extends SearchResultEntity
-
-
Field Summary
-
Fields inherited from class com.atlassian.confluence.plugins.rest.entities.SearchResultEntity
id
-
-
Constructor Summary
Constructors Constructor Description AttachmentEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLink(com.atlassian.plugins.rest.common.Link link)Add a link to the listbooleanequals(Object o)StringgetComment()Comment for the attachment.StringgetContentType()MIME type for the attached file, as reported by the browser when uploaded.DateEntitygetCreatedDate()Date this attachment was created.StringgetFileExtension()Returns the file extension of the attachment.StringgetFileName()Name of the file.longgetFileSize()Filesize in bytes.StringgetIconClass()DateEntitygetLastModifiedDate()Date this attachment was last modified.List<com.atlassian.plugins.rest.common.Link>getLinks()Links to this attachment, should always contain "self".StringgetNiceFileSize()Human readable representation of the filesize such as 16kStringgetNiceType()A nice type representation of the mime type such as "image" or "pdf"StringgetOwnerId()Id of the owner of this attachment.StringgetParentContentType()Content type of the parent of this attachmentStringgetParentDatePath()Date path of the parent of this attachment (if parent is blog)StringgetParentTitle()Title of the parent of this attachment.SpaceEntitygetSpace()Space where this attachment (and it's parent page if any) resides.intgetThumbnailHeight()com.atlassian.plugins.rest.common.LinkgetThumbnailLink()Link to a thumbnail representation of this attachment, only applicable to images.intgetThumbnailWidth()StringgetTitle()Title of the attachment.StringgetType()intgetVersion()Version number for the attachment.StringgetWikiLink()Link to this attachment in wiki format.inthashCode()voidsetComment(String comment)Comment for the attachment.voidsetContentType(String contentType)MIME type for the attached file, as reported by the browser when uploaded.voidsetCreatedDate(DateEntity createdDate)Date this attachment was created.voidsetFileName(String fileName)Name of the file.voidsetFileSize(long fileSize)Filesize in bytes.voidsetIconClass(String iconClass)voidsetLastModifiedDate(DateEntity lastModifiedDate)Date this attachment was last modified.voidsetNiceFileSize(String niceFileSize)Human readable representation of the filesize such as 16kvoidsetNiceType(String niceType)A nice type representation of the mime type such as "image" or "pdf"voidsetOwnerId(String ownerId)Id of the owner of this attachment.voidsetParentContentType(String parentContentType)Content type of the parent of this attachmentvoidsetParentDatePath(String parentDatePath)Date path of the parent of this attachment (if parent is blog)voidsetParentTitle(String parentTitle)Title of the parent of this attachment.voidsetSpace(SpaceEntity space)Space where this attachment (and it's parent page if any) resides.voidsetThumbnailHeight(int thumbnailHeight)voidsetThumbnailLink(com.atlassian.plugins.rest.common.Link thumbnailLink)Link to a thumbnail representation of this attachment, only applicable to images.voidsetThumbnailWidth(int thumbnailWidth)voidsetTitle(String title)Title of the attachment.voidsetVersion(int version)Version number for the attachment.voidsetWikiLink(String wikiLink)Link to this attachment in wiki format.StringtoString()-
Methods inherited from class com.atlassian.confluence.plugins.rest.entities.SearchResultEntity
getId, getIdLong, setId
-
-
-
-
Method Detail
-
getType
public String getType()
- Returns:
- the type
-
getOwnerId
public String getOwnerId()
Id of the owner of this attachment.- Returns:
- the ownerId
-
setOwnerId
public void setOwnerId(String ownerId)
Id of the owner of this attachment.- Parameters:
ownerId- the ownerId to set
-
getParentTitle
public String getParentTitle()
Title of the parent of this attachment.- Returns:
- the parentTitle
-
setParentTitle
public void setParentTitle(String parentTitle)
Title of the parent of this attachment.- Parameters:
parentTitle- the title to set
-
getParentContentType
public String getParentContentType()
Content type of the parent of this attachment- Returns:
- parentContentType
-
setParentContentType
public void setParentContentType(String parentContentType)
Content type of the parent of this attachment- Parameters:
parentContentType-
-
getParentDatePath
public String getParentDatePath()
Date path of the parent of this attachment (if parent is blog)- Returns:
- parentDatePath
-
setParentDatePath
public void setParentDatePath(String parentDatePath)
Date path of the parent of this attachment (if parent is blog)- Parameters:
parentDatePath-
-
getFileName
public String getFileName()
Name of the file.- Returns:
- the fileName
-
getContentType
public String getContentType()
MIME type for the attached file, as reported by the browser when uploaded.- Returns:
- the contentType
-
setContentType
public void setContentType(String contentType)
MIME type for the attached file, as reported by the browser when uploaded.- Parameters:
contentType- the contentType to set
-
getFileSize
public long getFileSize()
Filesize in bytes.- Returns:
- the fileSize
-
setFileSize
public void setFileSize(long fileSize)
Filesize in bytes.- Parameters:
fileSize- the fileSize to set
-
getNiceFileSize
public String getNiceFileSize()
Human readable representation of the filesize such as 16k- Returns:
- the niceFileSize
-
setNiceFileSize
public void setNiceFileSize(String niceFileSize)
Human readable representation of the filesize such as 16k- Parameters:
niceFileSize- the niceFileSize to set
-
getComment
public String getComment()
Comment for the attachment.- Returns:
- the comment
-
setComment
public void setComment(String comment)
Comment for the attachment.- Parameters:
comment- the comment to set
-
getVersion
public int getVersion()
Version number for the attachment.- Returns:
- the version
-
setVersion
public void setVersion(int version)
Version number for the attachment.- Parameters:
version- the version to set
-
setNiceType
public void setNiceType(String niceType)
A nice type representation of the mime type such as "image" or "pdf"- Parameters:
niceType- the niceType to set
-
getNiceType
public String getNiceType()
A nice type representation of the mime type such as "image" or "pdf"- Returns:
- the niceType
-
getTitle
public String getTitle()
Title of the attachment.- Returns:
- the title
-
setTitle
public void setTitle(String title)
Title of the attachment.- Parameters:
title- the title to set
-
getThumbnailLink
public com.atlassian.plugins.rest.common.Link getThumbnailLink()
Link to a thumbnail representation of this attachment, only applicable to images.- Returns:
- the thumbnailLink
-
setThumbnailLink
public void setThumbnailLink(com.atlassian.plugins.rest.common.Link thumbnailLink)
Link to a thumbnail representation of this attachment, only applicable to images.- Parameters:
thumbnailLink- the thumbnailLink to set
-
getThumbnailWidth
public int getThumbnailWidth()
-
setThumbnailWidth
public void setThumbnailWidth(int thumbnailWidth)
-
getThumbnailHeight
public int getThumbnailHeight()
-
setThumbnailHeight
public void setThumbnailHeight(int thumbnailHeight)
-
getWikiLink
public String getWikiLink()
Link to this attachment in wiki format.- Returns:
- the wikiLink
-
setWikiLink
public void setWikiLink(String wikiLink)
Link to this attachment in wiki format.- Parameters:
wikiLink- the wikiLink to set
-
getSpace
public SpaceEntity getSpace()
Space where this attachment (and it's parent page if any) resides.- Returns:
- the space
-
setSpace
public void setSpace(SpaceEntity space)
Space where this attachment (and it's parent page if any) resides.- Parameters:
space- the space to set
-
getLastModifiedDate
public DateEntity getLastModifiedDate()
Date this attachment was last modified.- Returns:
- the lastModifiedDate
-
setLastModifiedDate
public void setLastModifiedDate(DateEntity lastModifiedDate)
Date this attachment was last modified.- Parameters:
lastModifiedDate- the lastModifiedDate to set
-
getCreatedDate
public DateEntity getCreatedDate()
Date this attachment was created.- Returns:
- the createdDate
-
setCreatedDate
public void setCreatedDate(DateEntity createdDate)
Date this attachment was created.- Parameters:
createdDate- the createdDate to set
-
setFileName
public void setFileName(String fileName)
Name of the file. Also sets the title to the fileName.- Parameters:
fileName- the fileName to set
-
addLink
public void addLink(com.atlassian.plugins.rest.common.Link link)
Add a link to the list- Parameters:
link-
-
getLinks
public List<com.atlassian.plugins.rest.common.Link> getLinks()
Links to this attachment, should always contain "self".- Returns:
- the links
-
getIconClass
public String getIconClass()
-
setIconClass
public void setIconClass(String iconClass)
-
getFileExtension
public String getFileExtension()
Returns the file extension of the attachment. If there is no extension, an empty string is returned.- Returns:
- the file extension of the attachment in lower case
-
toString
public String toString()
- Overrides:
toStringin classSearchResultEntity
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classSearchResultEntity
-
hashCode
public int hashCode()
- Overrides:
hashCodein classSearchResultEntity
-
-