Package org.nuxeo.ecm.core.io.download
Class DownloadService.DownloadContext.Builder
java.lang.Object
org.nuxeo.ecm.core.io.download.DownloadService.DownloadContext.Builder
- Enclosing class:
- DownloadService.DownloadContext
Builder for a
DownloadService.DownloadContext.- Since:
- 11.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Blobprotected DocumentModelprotected Map<String,Serializable> protected Stringprotected Booleanprotected Calendarprotected Stringprotected final javax.servlet.http.HttpServletRequestprotected final javax.servlet.http.HttpServletResponseprotected String -
Constructor Summary
ConstructorsConstructorDescriptionBuilder(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) -
Method Summary
Modifier and TypeMethodDescriptionThe blob, if already fetched.blobTransferer(Consumer<ByteRange> blobTransferer) The consumer sending the blob's bytes to a client for a given byte range.build()Builds a finalDownloadService.DownloadContext.doc(DocumentModel doc) The document from which to download the blob.extendedInfos(Map<String, Serializable> extendedInfos) The extended infos, holding additional info about the download (in particular for logging and permission checks).The filename to use.Iftrue, specifiesContent-Disposition: inline, and iffalseusesContent-Disposition: attachment.lastModified(Calendar lastModified) The last modified date of the blob.The download reason.The blob's xpath in the document, or the blobholder index.
-
Field Details
-
request
protected final javax.servlet.http.HttpServletRequest request -
response
protected final javax.servlet.http.HttpServletResponse response -
doc
-
xpath
-
blob
-
filename
-
reason
-
extendedInfos
-
inline
-
blobTransferer
-
lastModified
-
-
Constructor Details
-
Builder
public Builder(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
-
Method Details
-
doc
The document from which to download the blob. -
xpath
The blob's xpath in the document, or the blobholder index. -
blob
The blob, if already fetched. Otherwise, it will be retrieved from the document and the xpath. -
filename
The filename to use. If absent, the blob's filename will be used. -
reason
The download reason.The request attribute
DownloadService.REQUEST_ATTR_DOWNLOAD_REASON, if present, will be used instead. -
extendedInfos
public DownloadService.DownloadContext.Builder extendedInfos(Map<String, Serializable> extendedInfos) The extended infos, holding additional info about the download (in particular for logging and permission checks).The request attribute
DownloadService.REQUEST_ATTR_DOWNLOAD_RENDITION, if present, will be used for therenditionkey. -
inline
Iftrue, specifiesContent-Disposition: inline, and iffalseusesContent-Disposition: attachment.If
null, a request parameterinlinewill be checked instead.By default,
Content-Disposition: inlinewill be used. -
blobTransferer
The consumer sending the blob's bytes to a client for a given byte range.The default is just to send to the response output stream, without buffering.
-
lastModified
The last modified date of the blob. -
build
Builds a finalDownloadService.DownloadContext.
-