public static final class BinaryDownloadOptions.BinaryDownloadOptionsBuilder
extends java.lang.Object
BinaryDownloadOptions
with the
options set as desired by the caller.Modifier and Type | Method and Description |
---|---|
@NotNull BinaryDownloadOptions |
build()
Construct a
BinaryDownloadOptions instance with the
properties specified to the builder. |
@NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder |
withCharacterEncoding(@NotNull java.lang.String characterEncoding)
Sets the character encoding of the
BinaryDownloadOptions object to be
built. |
@NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder |
withDispositionTypeAttachment()
Sets the disposition type of the
BinaryDownloadOptions object
to be built to attachment . |
@NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder |
withDispositionTypeInline()
Sets the disposition type of the
BinaryDownloadOptions object
to be built to inline . |
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.
|
@NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder |
withFileName(@NotNull java.lang.String fileName)
Sets the filename of the
BinaryDownloadOptions object to be
built. |
@NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder |
withMediaType(@NotNull java.lang.String mediaType)
Sets the internet media type of the
BinaryDownloadOptions object to be
built. |
@NotNull public @NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder withMediaType(@NotNull @NotNull java.lang.String mediaType)
BinaryDownloadOptions
object to be
built. This value should be a valid jcr:mimeType
.
Calling this method has the effect of instructing the service
provider to set mediaType
as the internet media type
in the Content-Type
header field of the response to a request
issued with a URI obtained by calling BinaryDownload.getURI(BinaryDownloadOptions)
. This value can be
later retrieved by calling BinaryDownloadOptions.getMediaType()
on the instance returned from a
call to build()
.
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-Type
header field will be
specified to the service provider.
mediaType
- The internet media type.@NotNull public @NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder withCharacterEncoding(@NotNull @NotNull java.lang.String characterEncoding)
BinaryDownloadOptions
object to be
built. This value should be a valid jcr:encoding
property value.
Calling this method has the effect of instructing the service
provider to set characterEncoding
as the "charset" parameter
of the content type in the Content-Type
header field of the
response to a request issued with a URI obtained by calling BinaryDownload.getURI(BinaryDownloadOptions)
. This value can be
later retrieved by calling BinaryDownloadOptions.getCharacterEncoding()
on the instance returned by a
call to build()
.
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.
characterEncoding
- A String representation of the jcr:encoding.@NotNull public @NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder withFileName(@NotNull @NotNull java.lang.String fileName)
BinaryDownloadOptions
object 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 fileName
as the filename in the Content-Disposition
header of the response to a request issued with
a URI obtained by calling BinaryDownload.getURI(BinaryDownloadOptions)
. This value can be
later retrieved by calling BinaryDownloadOptions.getFileName()
on the instance returned by a
call to build()
.
fileName
- The filename.@NotNull public @NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder withDispositionTypeInline()
BinaryDownloadOptions
object
to be built to inline
.
Calling this method has the effect of instructing the service
provider to set the disposition type in the Content-Disposition
header of the response to inline
. This
value can be later retrieved by calling BinaryDownloadOptions.getDispositionType()
on the instance built by
calling build()
.
If this value is not set, the default value of inline
will be used.
@NotNull public @NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder withDispositionTypeAttachment()
BinaryDownloadOptions
object
to be built to attachment
.
Calling this method has the effect of instructing the service
provider to set the disposition type in the Content-Disposition
header of the response to attachment
.
This value can later be retrieved by calling BinaryDownloadOptions.getDispositionType()
on the instance built by
calling build()
.
If this value is not set, the default value of inline
will be used.
public BinaryDownloadOptions.BinaryDownloadOptionsBuilder withDomainOverrideIgnored(boolean domainOverrideIgnored)
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).
domainOverrideIgnored
- @NotNull public @NotNull BinaryDownloadOptions build()
BinaryDownloadOptions
instance with the
properties specified to the builder.BinaryDownloadOptions
instance built with the
properties specified to the builder.Copyright © 2010 - 2020 Adobe. All Rights Reserved