Describes one file attached to a forum post, wall post or comment: its name, content hash, content type, size and display order. Built up via the fluent withX methods and read back by ForumManager when it creates the file attachment on the persisted post.
Group: Builders
Properties
| Property | Returns | Description |
|---|---|---|
| contentType | String | MIME type of the attached file, for example application/pdf. |
| fileHash | String | Content hash of the file, used as the lookup key into content storage. May be null until the file has been saved to 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. |
| ordinal | Integer | Display order of this file relative to other files attached to the same post, lowest first. |
Methods
getFileName() · withFileName(String fileName) · getFileHash() · withFileHash(String fileHash) · getContentType() · withContentType(String contentType) · getFileSize() · withFileSize(Long fileSize) · getOrdinal() · withOrdinal(Integer ordinal)
getFileName()
Returns: String
Name of the attached file, as it should be displayed and used when saving the file.
withFileName(String fileName)
Returns: FilePostBuilder
Sets the file name and returns this builder for chaining.
| Parameter | Description |
|---|---|
fileName | the file name to display and save under |
getFileHash()
Returns: String
Content hash of the file, used as the lookup key into content storage. May be null until the file has been saved to content storage.
withFileHash(String fileHash)
Returns: FilePostBuilder
Sets the content hash and returns this builder for chaining.
| Parameter | Description |
|---|---|
fileHash | the content hash to use as the lookup key in content storage |
getContentType()
Returns: String
MIME type of the attached file, for example application/pdf.
withContentType(String contentType)
Returns: FilePostBuilder
Sets the file's MIME type and returns this builder for chaining.
| Parameter | Description |
|---|---|
contentType | the MIME type of the file |
getFileSize()
Returns: Long
Size of the file in bytes.
withFileSize(Long fileSize)
Returns: FilePostBuilder
Sets the file size and returns this builder for chaining.
| Parameter | Description |
|---|---|
fileSize | the size of the file in bytes |
getOrdinal()
Returns: Integer
Display order of this file relative to other files attached to the same post, lowest first.
withOrdinal(Integer ordinal)
Returns: FilePostBuilder
Sets the display order and returns this builder for chaining.
| Parameter | Description |
|---|---|
ordinal | the ordinal position of this file relative to others on the same post |