public static final class BinaryDownloadOptions.BinaryDownloadOptionsBuilder extends 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 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 . |
@NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder |
withFileName(@NotNull String fileName)
Sets the filename of the
BinaryDownloadOptions object to be
built. |
@NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder |
withMediaType(@NotNull String mediaType)
Sets the internet media type of the
BinaryDownloadOptions object to be
built. |
@NotNull public @NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilder withMediaType(@NotNull @NotNull 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 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 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.
@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 © 2004–2020 The Apache Software Foundation. All rights reserved.