Package org.apache.jackrabbit.api.binary
Class BinaryDownloadOptions
java.lang.Object
org.apache.jackrabbit.api.binary.BinaryDownloadOptions
Specifies the options to be used when obtaining a direct download URI via
BinaryDownload.getURI(BinaryDownloadOptions). Setting these options
allows the caller to instruct the service provider that these options should
be applied to the response to a request made with the URI returned.
To specify download options, obtain a BinaryDownloadOptions.BinaryDownloadOptionsBuilder
via the builder() method, then specify the options desired and
get the object via BinaryDownloadOptions.BinaryDownloadOptionsBuilder.build().
If no options are needed, use DEFAULT which
instructs the implementation to use the service provider default behavior.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classUsed to build an instance ofBinaryDownloadOptionswith the options set as desired by the caller. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BinaryDownloadOptionsProvides a default instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull BinaryDownloadOptions.BinaryDownloadOptionsBuilderbuilder()Returns aBinaryDownloadOptions.BinaryDownloadOptionsBuilderinstance to be used for creating an instance of this class.final @Nullable StringReturns the character encoding that should be assumed for the binary that is to be downloaded.final @NotNull StringReturns the disposition type that should be assumed for the binary that is to be downloaded.final @Nullable StringReturns the filename that should be assumed for the binary that is to be downloaded.final @Nullable StringReturns the internet media type that should be assumed for the binary that is to be downloaded.booleanReturns a boolean value that indicates whether the data store should ignore any provided download domain override configuration value when generating the signed URI.
-
Field Details
-
DEFAULT
Provides a default instance of this class. Using the default instance indicates that the caller is willing to accept the service provider default behavior.
-
-
Method Details
-
getMediaType
Returns the internet media type that should be assumed for the binary that is to be downloaded. This value should be a validjcr:mimeType. This value can be set by callingBinaryDownloadOptions.BinaryDownloadOptionsBuilder.withMediaType(String)when building an instance of this class.- Returns:
- A String representation of the internet media type, or
nullif no type has been specified. - See Also:
-
getCharacterEncoding
Returns the character encoding that should be assumed for the binary that is to be downloaded. This value should be a validjcr:encoding. It can be set by callingBinaryDownloadOptions.BinaryDownloadOptionsBuilder.withCharacterEncoding(String)when building an instance of this class.- Returns:
- The character encoding, or
nullif no encoding has been specified. - See Also:
-
getFileName
Returns the filename that should be assumed for the binary that is to be downloaded. This value can be set by callingBinaryDownloadOptions.BinaryDownloadOptionsBuilder.withFileName(String)when building an instance of this class.- Returns:
- The file name, or
nullif no file name has been specified.
-
getDispositionType
Returns the disposition type that should be assumed for the binary that is to be downloaded. This value can be set by callingBinaryDownloadOptions.BinaryDownloadOptionsBuilder.withDispositionTypeInline()orBinaryDownloadOptions.BinaryDownloadOptionsBuilder.withDispositionTypeAttachment()when building an instance of this class. The default value of this setting is "inline".- Returns:
- The disposition type.
- See Also:
-
isDownloadDomainIgnored
public boolean isDownloadDomainIgnored()Returns a boolean value that indicates whether the data store should ignore any provided download domain override configuration value when generating the signed URI. This value can be set by callingBinaryDownloadOptions.BinaryDownloadOptionsBuilder.withDomainOverrideIgnored(boolean). The default value of this setting is false.- Returns:
- true if the domain override should be ignored; false otherwise.
-
builder
Returns aBinaryDownloadOptions.BinaryDownloadOptionsBuilderinstance to be used for creating an instance of this class.- Returns:
- A builder instance.
-