Package com.atlassian.confluence.pages
Record Class IndexableAttachment
java.lang.Object
java.lang.Record
com.atlassian.confluence.pages.IndexableAttachment
- All Implemented Interfaces:
- Searchable,- SearchableAttachment
public record IndexableAttachment(Attachment attachment)
extends Record
implements SearchableAttachment
A wrapper around an 
Attachment that implements the SearchableAttachment interface.- Since:
- 9.3
- 
Constructor SummaryConstructorsConstructorDescriptionIndexableAttachment(Attachment attachment) Creates an instance of aIndexableAttachmentrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the value of theattachmentrecord component.final booleanIndicates whether some other object is "equal to" this one.Return any comment associated with this attachmentReturn the contents of the attachment as an InputStreamgetContentsAsStream(AttachmentManager attachmentManager) Gets the MIME content-type of this attachment.static StringgetDescriptionForMimeType(String mimeType, String fileExtension) Gets the filename of this attachment.longgetId()When we un-index something (say, a page), we also need to un-index everything contained within that page (comments, attachments), because presumably they're all about to go away.final inthashCode()Returns a hash code value for this object.booleanAllows an object to tell the search indexer that it is not allowed to be indexedstatic IndexableAttachmentof(Attachment attachment) final StringtoString()Returns a string representation of this record class.
- 
Constructor Details- 
IndexableAttachmentCreates an instance of aIndexableAttachmentrecord class.- Parameters:
- attachment- the value for the- attachmentrecord component
 
 
- 
- 
Method Details- 
of
- 
getContentTypeDescription copied from interface:SearchableAttachmentGets the MIME content-type of this attachment. If there is no content-type, return "application/x-unknown". Should never return null.- Specified by:
- getContentTypein interface- SearchableAttachment
- Returns:
- the MIME content-type of the attachment, or "application/x-unknown" if the MIME type is unknown
 
- 
getFileNameDescription copied from interface:SearchableAttachmentGets the filename of this attachment. If there is no filename, return the empty string. This method should never return null.- Specified by:
- getFileNamein interface- SearchableAttachment
- Returns:
- the filename of this attachment, or the empty string if there is no filename
 
- 
getContentsAsStreamDescription copied from interface:SearchableAttachmentReturn the contents of the attachment as an InputStream- Specified by:
- getContentsAsStreamin interface- SearchableAttachment
- Returns:
- an InputStream set at the start of the attachment's contents.
 
- 
getContentsAsStream
- 
getCommentDescription copied from interface:SearchableAttachmentReturn any comment associated with this attachment- Specified by:
- getCommentin interface- SearchableAttachment
 
- 
getNiceType- Specified by:
- getNiceTypein interface- SearchableAttachment
 
- 
getDescriptionForMimeType- Parameters:
- mimeType- the mime type to be described. Should not be null
- fileExtension- the file extension to help with the deriving of the description.
- Returns:
- A more displayable description for the supplied mime type. If a blank String is supplied then null will be returned.
 
- 
getNiceFileSize- Specified by:
- getNiceFileSizein interface- SearchableAttachment
 
- 
getDownloadPath- Specified by:
- getDownloadPathin interface- SearchableAttachment
 
- 
getIdpublic long getId()- Specified by:
- getIdin interface- Searchable
 
- 
getSearchableDependantsDescription copied from interface:SearchableWhen we un-index something (say, a page), we also need to un-index everything contained within that page (comments, attachments), because presumably they're all about to go away.- Specified by:
- getSearchableDependantsin interface- Searchable
 
- 
isIndexablepublic boolean isIndexable()Description copied from interface:SearchableAllows an object to tell the search indexer that it is not allowed to be indexed- Specified by:
- isIndexablein interface- Searchable
 
- 
toStringReturns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
- 
hashCodepublic final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
- 
equalsIndicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object).
- 
attachmentReturns the value of theattachmentrecord component.- Returns:
- the value of the attachmentrecord component
 
 
-