|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.core.bean.EntityObject
com.atlassian.confluence.core.ConfluenceEntityObject
com.atlassian.confluence.core.AbstractVersionedEntityObject
com.atlassian.confluence.core.AbstractLabelableEntityObject
com.atlassian.confluence.pages.Attachment
public class Attachment
Nested Class Summary | |
---|---|
static class |
Attachment.Type
An enum of basic Attachment types with a text description of each type. |
Field Summary | |
---|---|
static String |
API_REVISION
|
static String |
API_REVISION_V2
|
static String |
CONTENT_TYPE
|
static String |
DOWNLOAD_PATH_BASE
The download path for an attachment is composed with this base, see getDownloadPathWithoutEncoding() for an example. |
static String |
PROFILE_PICTURE_COMMENT
|
Fields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject |
---|
INITIAL_VERSION |
Constructor Summary | |
---|---|
Attachment()
|
|
Attachment(String fileName,
String contentType,
long fileSize,
String comment)
Constructs a new Attachment. |
Method Summary | |
---|---|
Object |
clone()
|
Attachment |
copy()
|
boolean |
equals(Object o)
|
Integer |
getAttachmentVersion()
|
String |
getComment()
|
ContentEntityObject |
getContent()
The object to which the attachment is attached. |
InputStream |
getContentsAsStream()
|
String |
getContentType()
|
static String |
getDescriptionForMimeType(String mimeType,
String fileExtension)
|
String |
getDisplayTitle()
|
String |
getDownloadPath()
|
String |
getDownloadPath(String attachmentPath,
boolean addVersionInfo)
Returns the download path of the attachment for a given attachmentPath prefix. |
String |
getDownloadPathWithoutEncoding()
|
String |
getDownloadPathWithoutVersion()
Returns the download path without any version info. |
String |
getExportPath()
|
String |
getExportPathForThumbnail()
|
String |
getFileExtension()
Returns the file extension of the attachment. |
String |
getFileName()
|
long |
getFileSize()
|
protected Collection |
getImageDetailsDTO()
accessor methods provided for hibernate proxy use only. |
String |
getLinkWikiMarkup()
|
String |
getNiceFileSize()
|
String |
getNiceType()
|
Collection |
getSearchableDependants()
|
Space |
getSpace()
|
String |
getTitle()
|
String |
getType()
|
String |
getUrlPath()
|
int |
hashCode()
|
boolean |
isIndexable()
Only the current version of an attachment is indexable (until we can deal with old objects in search results) We also don't want to index attachments associated with drafts or global descriptions. |
boolean |
isUserProfilePicture()
Determines whether the Attachment is a user's profile picture |
void |
setAttachmentVersion(Integer attachmentVersion)
|
void |
setComment(String comment)
|
void |
setContent(ContentEntityObject content)
|
void |
setContentType(String contentType)
|
void |
setFileName(String fileName)
|
void |
setFileSize(long fileSize)
|
protected void |
setImageDetailsDTO(Set imageDetailDTOs)
|
String |
toString()
|
Methods inherited from class com.atlassian.confluence.core.AbstractLabelableEntityObject |
---|
addLabelling, getGlobalLabels, getLabelCount, getLabellings, getLabels, getLabelsForDisplay, getLabelUtil, getPersonalLabels, getTeamLabels, getVisibleLabels, isFavourite, isFavourite, removeLabelling, setLabellings |
Methods inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject |
---|
convertToHistoricalVersion, getLatestVersion, getOriginalVersion, getVersion, isLatestVersion, isNew, setOriginalVersion, setVersion |
Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject |
---|
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierName |
Methods inherited from class com.atlassian.core.bean.EntityObject |
---|
getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.atlassian.bonnie.Searchable |
---|
getId |
Methods inherited from interface com.atlassian.confluence.core.Addressable |
---|
getId |
Methods inherited from interface com.atlassian.confluence.labels.EditableLabelable |
---|
getId, isPersistent |
Field Detail |
---|
public static final String CONTENT_TYPE
public static final String PROFILE_PICTURE_COMMENT
public static final String API_REVISION
public static final String API_REVISION_V2
public static final String DOWNLOAD_PATH_BASE
getDownloadPathWithoutEncoding()
for an example.
Constructor Detail |
---|
public Attachment()
public Attachment(String fileName, String contentType, long fileSize, String comment)
Method Detail |
---|
public Integer getAttachmentVersion()
public void setAttachmentVersion(Integer attachmentVersion)
public String getFileName()
getFileName
in interface com.atlassian.bonnie.search.SearchableAttachment
public void setFileName(String fileName)
public String getContentType()
getContentType
in interface com.atlassian.bonnie.search.SearchableAttachment
public void setContentType(String contentType)
public ContentEntityObject getContent()
public void setContent(ContentEntityObject content)
public String getComment()
getComment
in interface com.atlassian.bonnie.search.SearchableAttachment
public void setComment(String comment)
public long getFileSize()
public void setFileSize(long fileSize)
public String getNiceFileSize()
getNiceFileSize
in interface com.atlassian.bonnie.search.SearchableAttachment
public String getNiceType()
getNiceType
in interface com.atlassian.bonnie.search.SearchableAttachment
public String getType()
getType
in interface ContentTypeAware
public String getDisplayTitle()
getDisplayTitle
in interface Addressable
public String getTitle()
getTitle
in interface EditableLabelable
public String getUrlPath()
getUrlPath
in interface Addressable
public Collection getSearchableDependants()
getSearchableDependants
in interface com.atlassian.bonnie.Searchable
public boolean isUserProfilePicture()
public boolean isIndexable()
isIndexable
in interface com.atlassian.bonnie.Searchable
public String getDownloadPath()
getDownloadPath
in interface com.atlassian.bonnie.search.SearchableAttachment
public String getDownloadPathWithoutVersion()
public String getDownloadPath(String attachmentPath, boolean addVersionInfo)
attachmentPath
- addVersionInfo
-
public String getDownloadPathWithoutEncoding()
public String getExportPath()
public String getExportPathForThumbnail()
public InputStream getContentsAsStream() throws IOException
getContentsAsStream
in interface com.atlassian.bonnie.search.SearchableAttachment
IOException
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class com.atlassian.core.bean.EntityObject
public boolean equals(Object o)
equals
in class com.atlassian.core.bean.EntityObject
public String getFileExtension()
public static String getDescriptionForMimeType(String mimeType, String fileExtension)
mimeType
- the mime type to be described. Should not be nullfileExtension
- the file extension to help with the deriving of the description.
public Space getSpace()
getSpace
in interface Spaced
Spaced
), or null otherwise.public String getLinkWikiMarkup()
getLinkWikiMarkup
in interface HasLinkWikiMarkup
protected Collection getImageDetailsDTO()
ImageDetailsManager
.getImageDetails(Attachment attachment)
protected void setImageDetailsDTO(Set imageDetailDTOs)
public Object clone() throws CloneNotSupportedException
clone
in class AbstractLabelableEntityObject
CloneNotSupportedException
public Attachment copy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |