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

PropertyReturnsDescription
contentTypeStringMIME type of the attached file, for example application/pdf.
fileHashStringContent hash of the file, used as the lookup key into content storage. May be null until the file has been saved to content storage.
fileNameStringName of the attached file, as it should be displayed and used when saving the file.
fileSizeLongSize of the file in bytes.
ordinalIntegerDisplay 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.

ParameterDescription
fileNamethe 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.

ParameterDescription
fileHashthe 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.

ParameterDescription
contentTypethe 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.

ParameterDescription
fileSizethe 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.

ParameterDescription
ordinalthe ordinal position of this file relative to others on the same post
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.