com.atlassian.confluence.pages
Class Attachment
java.lang.Object
com.atlassian.core.bean.EntityObject
com.atlassian.confluence.core.ConfluenceEntityObject
com.atlassian.confluence.core.AbstractVersionedEntityObject
com.atlassian.confluence.pages.Attachment
- All Implemented Interfaces:
- SearchableAttachment, Searchable, Addressable, Versioned, Serializable, Cloneable
public class Attachment
- extends AbstractVersionedEntityObject
- implements SearchableAttachment, Addressable
- See Also:
- Serialized Form
| Methods inherited from interface com.atlassian.confluence.core.Addressable |
getId |
CONTENT_TYPE
public static final String CONTENT_TYPE
- See Also:
- Constant Field Values
PROFILE_PICTURE_COMMENT
public static final String PROFILE_PICTURE_COMMENT
- See Also:
- Constant Field Values
Attachment
public Attachment()
Attachment
public Attachment(String fileName,
String contentType,
long fileSize,
String comment)
- Constructs a new Attachment.
- Parameters:
fileName - contentType - fileSize - comment -
getAttachmentVersion
public Integer getAttachmentVersion()
setAttachmentVersion
public void setAttachmentVersion(Integer attachmentVersion)
getFileName
public String getFileName()
- Specified by:
getFileName in interface SearchableAttachment
setFileName
public void setFileName(String fileName)
getContentType
public String getContentType()
- Specified by:
getContentType in interface SearchableAttachment
setContentType
public void setContentType(String contentType)
getContent
public ContentEntityObject getContent()
- The page of this attachment.
setContent
public void setContent(ContentEntityObject content)
getComment
public String getComment()
- Specified by:
getComment in interface SearchableAttachment
setComment
public void setComment(String comment)
getFileSize
public long getFileSize()
setFileSize
public void setFileSize(long fileSize)
getNiceFileSize
public String getNiceFileSize()
- Specified by:
getNiceFileSize in interface SearchableAttachment
getNiceType
public String getNiceType()
- Specified by:
getNiceType in interface SearchableAttachment
- Returns:
- A nice type for this file if possible (eg "PDF" or "Word") - or null if no nice type can be recognised
getType
public String getType()
- Specified by:
getType in interface Addressable
getRealTitle
public String getRealTitle()
- Specified by:
getRealTitle in interface Addressable
getUrlPath
public String getUrlPath()
- Specified by:
getUrlPath in interface Addressable
getSearchableDependants
public Collection getSearchableDependants()
- Specified by:
getSearchableDependants in interface Searchable
isUserProfilePicture
public boolean isUserProfilePicture()
- Determines whether the Attachment is a user's profile picture
- Returns:
- true if it is attached to a PersonalInformation object and has the correct comment
isIndexable
public boolean isIndexable()
- Only the current version of an attachment is indexable (until we can deal with old objects
in search results)
- Specified by:
isIndexable in interface Searchable
getDownloadPath
public String getDownloadPath()
- Specified by:
getDownloadPath in interface SearchableAttachment
getDownloadPathWithoutVersion
public String getDownloadPathWithoutVersion()
getContentsAsStream
public InputStream getContentsAsStream()
throws IOException
- Specified by:
getContentsAsStream in interface SearchableAttachment
- Throws:
IOException
toString
public String toString()
- Overrides:
toString in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class EntityObject
equals
public boolean equals(Object o)
- Overrides:
equals in class EntityObject