|
||||||||||
| 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 java.lang.String |
API_REVISION
|
static java.lang.String |
API_REVISION_V2
|
static java.lang.String |
CONTENT_TYPE
|
static java.lang.String |
DOWNLOAD_PATH_BASE
The download path for an attachment is composed with this base, see getDownloadPathWithoutEncoding() for an example. |
static java.lang.String |
PROFILE_PICTURE_COMMENT
|
| Fields inherited from class com.atlassian.confluence.core.AbstractVersionedEntityObject |
|---|
INITIAL_VERSION |
| Constructor Summary | |
|---|---|
Attachment()
|
|
Attachment(java.lang.String fileName,
java.lang.String contentType,
long fileSize,
java.lang.String comment)
Constructs a new Attachment. |
|
Attachment(java.lang.String fileName,
java.lang.String contentType,
long fileSize,
java.lang.String comment,
boolean minorEdit)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
Attachment |
copy()
|
boolean |
equals(java.lang.Object o)
|
java.lang.Integer |
getAttachmentVersion()
|
java.lang.String |
getComment()
|
ContentEntityObject |
getContent()
The object to which the attachment is attached. |
ContentId |
getContentId()
|
java.io.InputStream |
getContentsAsStream()
Deprecated. since 5.5. Use AttachmentManager.getAttachmentData(Attachment) |
java.lang.String |
getContentType()
|
static java.lang.String |
getDescriptionForMimeType(java.lang.String mimeType,
java.lang.String fileExtension)
|
java.lang.String |
getDisplayTitle()
|
java.lang.String |
getDownloadPath()
|
java.lang.String |
getDownloadPath(java.lang.String attachmentPath,
boolean addVersionInfo)
Returns the download path of the attachment for a given attachmentPath prefix. |
java.lang.String |
getDownloadPathWithoutEncoding()
|
java.lang.String |
getDownloadPathWithoutVersion()
Returns the download path without any version info. |
java.lang.String |
getExportPath()
|
java.lang.String |
getExportPathForThumbnail()
|
java.lang.String |
getFileExtension()
Returns the file extension of the attachment. |
java.lang.String |
getFileName()
|
long |
getFileSize()
|
protected java.util.Collection |
getImageDetailsDTO()
accessor methods provided for hibernate proxy use only. |
java.lang.String |
getLinkWikiMarkup()
|
java.lang.String |
getNiceFileSize()
|
java.lang.String |
getNiceType()
|
java.util.Collection |
getSearchableDependants()
|
Space |
getSpace()
|
java.lang.String |
getTitle()
|
java.lang.String |
getType()
|
java.lang.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 |
isMinorEdit()
Indicates whether this attachment is supposed to be hidden under normal circumstances. |
boolean |
isUserProfilePicture()
Determines whether the Attachment is a user's profile picture |
void |
setAttachmentVersion(java.lang.Integer attachmentVersion)
|
void |
setComment(java.lang.String comment)
|
void |
setContent(ContentEntityObject content)
|
void |
setContentType(java.lang.String contentType)
|
void |
setFileName(java.lang.String fileName)
|
void |
setFileSize(long fileSize)
|
protected void |
setImageDetailsDTO(java.util.Set imageDetailDTOs)
|
void |
setMinorEdit(boolean minorEdit)
|
java.lang.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 java.lang.String CONTENT_TYPE
public static final java.lang.String PROFILE_PICTURE_COMMENT
public static final java.lang.String API_REVISION
public static final java.lang.String API_REVISION_V2
public static final java.lang.String DOWNLOAD_PATH_BASE
getDownloadPathWithoutEncoding() for an example.
| Constructor Detail |
|---|
public Attachment()
public Attachment(java.lang.String fileName,
java.lang.String contentType,
long fileSize,
java.lang.String comment,
boolean minorEdit)
public Attachment(java.lang.String fileName,
java.lang.String contentType,
long fileSize,
java.lang.String comment)
| Method Detail |
|---|
public java.lang.Integer getAttachmentVersion()
public void setAttachmentVersion(java.lang.Integer attachmentVersion)
public java.lang.String getFileName()
getFileName in interface com.atlassian.bonnie.search.SearchableAttachmentpublic void setFileName(java.lang.String fileName)
public java.lang.String getContentType()
getContentType in interface com.atlassian.bonnie.search.SearchableAttachmentpublic void setContentType(java.lang.String contentType)
public ContentEntityObject getContent()
public void setContent(ContentEntityObject content)
public java.lang.String getComment()
getComment in interface com.atlassian.bonnie.search.SearchableAttachmentpublic void setComment(java.lang.String comment)
public boolean isMinorEdit()
public void setMinorEdit(boolean minorEdit)
public long getFileSize()
public void setFileSize(long fileSize)
public java.lang.String getNiceFileSize()
getNiceFileSize in interface com.atlassian.bonnie.search.SearchableAttachmentpublic java.lang.String getNiceType()
getNiceType in interface com.atlassian.bonnie.search.SearchableAttachmentpublic java.lang.String getType()
getType in interface ContentTypeAwarepublic java.lang.String getDisplayTitle()
getDisplayTitle in interface Addressablepublic java.lang.String getTitle()
getTitle in interface EditableLabelablepublic java.lang.String getUrlPath()
getUrlPath in interface Addressablepublic java.util.Collection getSearchableDependants()
getSearchableDependants in interface com.atlassian.bonnie.Searchablepublic boolean isUserProfilePicture()
public boolean isIndexable()
isIndexable in interface com.atlassian.bonnie.Searchablepublic java.lang.String getDownloadPath()
getDownloadPath in interface com.atlassian.bonnie.search.SearchableAttachmentpublic java.lang.String getDownloadPathWithoutVersion()
public java.lang.String getDownloadPath(java.lang.String attachmentPath,
boolean addVersionInfo)
attachmentPath - addVersionInfo -
public java.lang.String getDownloadPathWithoutEncoding()
public java.lang.String getExportPath()
public java.lang.String getExportPathForThumbnail()
@Deprecated
public java.io.InputStream getContentsAsStream()
throws java.io.IOException
AttachmentManager.getAttachmentData(Attachment)
getContentsAsStream in interface com.atlassian.bonnie.search.SearchableAttachmentjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class com.atlassian.core.bean.EntityObjectpublic boolean equals(java.lang.Object o)
equals in class com.atlassian.core.bean.EntityObjectpublic java.lang.String getFileExtension()
public static java.lang.String getDescriptionForMimeType(java.lang.String mimeType,
java.lang.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 SpacedSpaced), or null otherwise.public java.lang.String getLinkWikiMarkup()
getLinkWikiMarkup in interface HasLinkWikiMarkupprotected java.util.Collection getImageDetailsDTO()
ImageDetailsManager.getImageDetails(Attachment attachment)
protected void setImageDetailsDTO(java.util.Set imageDetailDTOs)
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class AbstractLabelableEntityObjectjava.lang.CloneNotSupportedExceptionpublic Attachment copy()
public ContentId getContentId()
getContentId in interface ContentConvertible
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||