Describes one file attached to a forum post or comment: its name, content hash, content type, size, an optional note and its display order. Built up fluently and consumed by ForumManager's PostBuilder when the post is created, where each attachment becomes a file attachment on the persisted post. Obtained from the addAttachment() method on ForumManager's PostBuilder; there is no build() call, the post builder reads the values off it when the post is saved.
Group: Builders
Properties
| Property | Returns | Description |
|---|---|---|
| contentType | String | MIME type of the attached file, for example application/pdf. |
| fileHash | String | Content hash of the attached file, used as the lookup key into content storage. |
| fileName | String | Name of the attached file, as it should be displayed and used when saving the file. |
| fileSize | Long | Size of the file in bytes. |
| notes | String | Free-text note attached to this file, if any. |
| ordinal | Integer | Display order of this file relative to other files attached to the same post, lowest first. |
Methods
getFileHash() · getFileName() · getFileSize() · getContentType() · getNotes() · getOrdinal() · fileName(String s) · fileHash(String s) · contentType(String s) · fileSize(Long s) · notes(String s) · ordinal(Integer s)
getFileHash()
Returns: String
Content hash of the attached file, used as the lookup key into content storage.
getFileName()
Returns: String
Name of the attached file, as it should be displayed and used when saving the file.
getFileSize()
Returns: Long
Size of the file in bytes.
getContentType()
Returns: String
MIME type of the attached file, for example application/pdf.
getNotes()
Returns: String
Free-text note attached to this file, if any.
getOrdinal()
Returns: Integer
Display order of this file relative to other files attached to the same post, lowest first.
fileName(String s)
Returns: PostAttachmentBuilder
Sets the file name and returns this builder for chaining.
| Parameter | Description |
|---|---|
s | the file name to display and save under |
fileHash(String s)
Returns: PostAttachmentBuilder
Sets the content hash and returns this builder for chaining.
| Parameter | Description |
|---|---|
s | the content hash to use as the lookup key in content storage |
contentType(String s)
Returns: PostAttachmentBuilder
Sets the file's MIME type and returns this builder for chaining.
| Parameter | Description |
|---|---|
s | the MIME type of the file |
fileSize(Long s)
Returns: PostAttachmentBuilder
Sets the file size and returns this builder for chaining.
| Parameter | Description |
|---|---|
s | the size of the file in bytes |
notes(String s)
Returns: PostAttachmentBuilder
Sets a free-text note for the file and returns this builder for chaining.
| Parameter | Description |
|---|---|
s | the note to attach to the file |
ordinal(Integer s)
Returns: PostAttachmentBuilder
Sets the display order and returns this builder for chaining.
| Parameter | Description |
|---|---|
s | the ordinal position of this file relative to others on the same post |