Class DataRecordDownloadOptions
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.blob.datastore.directaccess.DataRecordDownloadOptions
-
public class DataRecordDownloadOptions extends Object
Contains download options for downloading a data record directly from a storage location using the direct download feature.
-
-
Field Summary
Fields Modifier and Type Field Description static DataRecordDownloadOptions
DEFAULT
Provides a default implementation of this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataRecordDownloadOptions
fromBlobDownloadOptions(@NotNull BlobDownloadOptions downloadOptions)
Create an instance of this class directly from aBlobDownloadOptions
instance.@Nullable String
getCharacterEncoding()
Returns the character encoding of this instance.@Nullable String
getContentDispositionHeader()
Generate the correct HTTPContent-Disposition
header value from thefileName
anddispositionType
in this class, if set.@Nullable String
getContentTypeHeader()
Generate the correct HTTPContent-Type
header value from themediaType
andcharacterEncoding
in this class, if set.@Nullable String
getDispositionType()
Returns the disposition type of this instance.@Nullable String
getFileName()
Returns the file name of this instance.@Nullable String
getMediaType()
Returns the media type of this instance.boolean
isDomainOverrideIgnored()
Indicates whether the data store should ignore any configured download domain override value when generating the signed download URI.
-
-
-
Field Detail
-
DEFAULT
public static DataRecordDownloadOptions DEFAULT
Provides a default implementation of this class. Clients should use this instance when they have no options to specify and are willing to accept the service provider default behavior.
-
-
Method Detail
-
fromBlobDownloadOptions
public static DataRecordDownloadOptions fromBlobDownloadOptions(@NotNull @NotNull BlobDownloadOptions downloadOptions)
Create an instance of this class directly from aBlobDownloadOptions
instance.- Parameters:
downloadOptions
- The download options to use to initialize this instance.- Returns:
- The new instance of this class.
-
getContentTypeHeader
@Nullable public @Nullable String getContentTypeHeader()
Generate the correct HTTPContent-Type
header value from themediaType
andcharacterEncoding
in this class, if set.If
mediaType
has not been given a value, this method will returnnull
.- Returns:
- The correct value for a
Content-Type
header, ornull
if themediaType
has not been specified.
-
getContentDispositionHeader
@Nullable public @Nullable String getContentDispositionHeader()
Generate the correct HTTPContent-Disposition
header value from thefileName
anddispositionType
in this class, if set.A value will be returned if the file name has been set, OR if the disposition type has been explicitly set to "attachment". Otherwise
null
will be returned.- Returns:
- The correct value for a
Content-Disposition
header, ornull
if thefileName
has not been specified and thedispositionType
has not been set to "attachment".
-
getMediaType
@Nullable public @Nullable String getMediaType()
Returns the media type of this instance.- Returns:
- The media type, or
null
if it has not been set.
-
getCharacterEncoding
@Nullable public @Nullable String getCharacterEncoding()
Returns the character encoding of this instance.- Returns:
- The character encoding, or
null
if it has not been set.
-
getFileName
@Nullable public @Nullable String getFileName()
Returns the file name of this instance.- Returns:
- The file name, or
null
if it has not been set.
-
getDispositionType
@Nullable public @Nullable String getDispositionType()
Returns the disposition type of this instance.- Returns:
- The disposition type, or
null
if it has not been set.
-
isDomainOverrideIgnored
public boolean isDomainOverrideIgnored()
Indicates whether the data store should ignore any configured download domain override value when generating the signed download URI.- Returns:
- true if the domain override should be ignored; false otherwise.
-
-