Streams a stored content item to the response, looked up by content name and an optional storage directory. Created via ViewsBuilder.contentFileView(...) from server-side JS and returned from a controller as the view for a request. Content is normally read through FileStorageManager, scoped to the current tenant; a legacy special case reads uploaded report tables through TableUploadManager when the directory is "reports" and the content name has a "content-table:" prefix, kept for backwards compatibility.

Group: Views

Implements: View, Serializable


Properties

PropertyReturnsDescription
contentTypeStringThe content type supplied at construction, sent as the response's content type.
descriptionStringShort, user-facing label for this view, always "Content file view".

Methods

getDescription()

Returns: String

Short, user-facing label for this view, always "Content file view".

render(CommonResource page, OutputStream out, Range range, Map<String,String> params, String contentType)

Returns: void

Writes the stored content's bytes to the response output stream. Reads through TableUploadManager for the legacy "reports" / "content-table:" case, otherwise reads through FileStorageManager, scoped by directory when one was given at construction.

ParameterDescription
pagethe resource the view is being rendered for, not used by this view
outthe stream the content bytes are written to
rangenot used by this view; the full content is always written
paramsrequest parameters, not used by this view
contentTypenot used by this view; getContentType() supplies the response content type

getContentType()

Returns: String

The content type supplied at construction, sent as the response's content type.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.