Class BinaryDownloadOptions.BinaryDownloadOptionsBuilder
- Enclosing class:
- BinaryDownloadOptions
BinaryDownloadOptions with the
options set as desired by the caller.-
Method Summary
Modifier and TypeMethodDescription@NotNull BinaryDownloadOptionsbuild()Construct aBinaryDownloadOptionsinstance with the properties specified to the builder.withCharacterEncoding(@NotNull String characterEncoding) Sets the character encoding of theBinaryDownloadOptionsobject to be built.Sets the disposition type of theBinaryDownloadOptionsobject to be built toattachment.Sets the disposition type of theBinaryDownloadOptionsobject to be built toinline.withDomainOverrideIgnored(boolean domainOverrideIgnored) Sets a flag to indicate whether any configured download domain override value should be ignored when generating the signed download URI.withFileName(@NotNull String fileName) Sets the filename of theBinaryDownloadOptionsobject to be built.withMediaType(@NotNull String mediaType) Sets the internet media type of theBinaryDownloadOptionsobject to be built.
-
Method Details
-
withMediaType
@NotNull public @NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder withMediaType(@NotNull @NotNull String mediaType) Sets the internet media type of theBinaryDownloadOptionsobject to be built. This value should be a validjcr:mimeType.Calling this method has the effect of instructing the service provider to set
mediaTypeas the internet media type in theContent-Typeheader field of the response to a request issued with a URI obtained by callingBinaryDownload.getURI(BinaryDownloadOptions). This value can be later retrieved by callingBinaryDownloadOptions.getMediaType()on the instance returned from a call tobuild().Note that if the internet media type defines a "charset" parameter (as many textual types do), the caller may also wish to set the character encoding which is done separately. See
withCharacterEncoding(String).The caller should ensure that the internet media type set is valid; the implementation does not perform any validation of this setting.
If no internet media type is provided, no
Content-Typeheader field will be specified to the service provider.- Parameters:
mediaType- The internet media type.- Returns:
- The calling instance.
- See Also:
-
withCharacterEncoding
@NotNull public @NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder withCharacterEncoding(@NotNull @NotNull String characterEncoding) Sets the character encoding of theBinaryDownloadOptionsobject to be built. This value should be a validjcr:encodingproperty value.Calling this method has the effect of instructing the service provider to set
characterEncodingas the "charset" parameter of the content type in theContent-Typeheader field of the response to a request issued with a URI obtained by callingBinaryDownload.getURI(BinaryDownloadOptions). This value can be later retrieved by callingBinaryDownloadOptions.getCharacterEncoding()on the instance returned by a call tobuild().Note that setting the character encoding only makes sense if the internet media type has also been set, and that media type actually defines a "charset" parameter. See
withMediaType(String).The caller should ensure that the proper character encoding has been set for the internet media type; the implementation does not perform any validation of these settings.
- Parameters:
characterEncoding- A String representation of the jcr:encoding.- Returns:
- The calling instance.
- See Also:
-
withFileName
@NotNull public @NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder withFileName(@NotNull @NotNull String fileName) Sets the filename of theBinaryDownloadOptionsobject to be built. This would typically be based on a JCR node name.Calling this method has the effect of instructing the service provider to set
fileNameas the filename in theContent-Dispositionheader of the response to a request issued with a URI obtained by callingBinaryDownload.getURI(BinaryDownloadOptions). This value can be later retrieved by callingBinaryDownloadOptions.getFileName()on the instance returned by a call tobuild().- Parameters:
fileName- The filename.- Returns:
- The calling instance.
- See Also:
-
withDispositionTypeInline
@NotNull public @NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder withDispositionTypeInline()Sets the disposition type of theBinaryDownloadOptionsobject to be built toinline.Calling this method has the effect of instructing the service provider to set the disposition type in the
Content-Dispositionheader of the response toinline. This value can be later retrieved by callingBinaryDownloadOptions.getDispositionType()on the instance built by callingbuild().If this value is not set, the default value of
inlinewill be used.- Returns:
- The calling instance.
-
withDispositionTypeAttachment
@NotNull public @NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder withDispositionTypeAttachment()Sets the disposition type of theBinaryDownloadOptionsobject to be built toattachment.Calling this method has the effect of instructing the service provider to set the disposition type in the
Content-Dispositionheader of the response toattachment. This value can later be retrieved by callingBinaryDownloadOptions.getDispositionType()on the instance built by callingbuild().If this value is not set, the default value of
inlinewill be used.- Returns:
- The calling instance.
-
withDomainOverrideIgnored
public BinaryDownloadOptions.BinaryDownloadOptionsBuilder withDomainOverrideIgnored(boolean domainOverrideIgnored) Sets a flag to indicate whether any configured download domain override value should be ignored when generating the signed download URI.The default value of this flag is false. This means that if a download domain override configuration value is provided, that value will be used in a signed download URI as the hostname, and if not provided the default hostname will be used instead. However, if this flag is set to true, the implementation will use the default hostname for the signed download URI regardless of whether the download domain override value is configured or not. Most clients will want to accept the default behavior. However, if a client understands its deployment topology it may know that ignoring the download domain override will provide better performance. An example of this is if the client is a service running in the same cloud region as the blob store, in which case accessing the storage directly is almost always faster than going through a domain override (e.g. CDN domain).
- Parameters:
domainOverrideIgnored-- Returns:
- The calling instance.
-
build
Construct aBinaryDownloadOptionsinstance with the properties specified to the builder.- Returns:
- A new
BinaryDownloadOptionsinstance built with the properties specified to the builder.
-