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

PropertyReturnsDescription
contentTypeStringMIME type of the attached file, for example application/pdf.
fileHashStringContent hash of the attached file, used as the lookup key into content storage.
fileNameStringName of the attached file, as it should be displayed and used when saving the file.
fileSizeLongSize of the file in bytes.
notesStringFree-text note attached to this file, if any.
ordinalIntegerDisplay 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.

ParameterDescription
sthe file name to display and save under

fileHash(String s)

Returns: PostAttachmentBuilder

Sets the content hash and returns this builder for chaining.

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

ParameterDescription
sthe MIME type of the file

fileSize(Long s)

Returns: PostAttachmentBuilder

Sets the file size and returns this builder for chaining.

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

ParameterDescription
sthe note to attach to the file

ordinal(Integer s)

Returns: PostAttachmentBuilder

Sets the display order and returns this builder for chaining.

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