@ProviderType public interface BinaryDownload extends Binary
Binary
directly from a storage location.Modifier and Type | Method and Description |
---|---|
@Nullable java.net.URI |
getURI(BinaryDownloadOptions downloadOptions)
Returns a URI for downloading this binary directly from the storage location.
|
@Nullable @Nullable java.net.URI getURI(BinaryDownloadOptions downloadOptions) throws RepositoryException
Using the downloadOptions
parameter, some response headers of the
download request can be overwritten, if supported by the storage provider.
This is necessary to pass information that is only stored in the JCR in
application specific structures, and not reliably available in the binary
storage.
BinaryDownloadOptions
supports, but is not limited to:
Content-Type media type
:
typically available in a jcr:mimeType
property
Content-Type charset
:
for media types defining a "charset", typically available in a jcr:encoding
property
Content-Disposition filename
:
download file name, typically taken from a JCR node name in the parent hierarchy, such as the nt:file node name
Content-Disposition type
:
whether to show the content inline of a page (inline) or enforce a download/save as (attachment)
BinaryDownloadOptions.DEFAULT
will use mostly empty
defaults, relying on the storage provider attributes for this binary
(that might be empty or different from the information in the JCR).
Security considerations:
downloadOptions
- A BinaryDownloadOptions
instance which is used to
request specific options on the binary to be downloaded.
BinaryDownloadOptions.DEFAULT
should be used if the
caller wishes to accept the storage provider's default
behavior.null
if the
binary cannot be downloaded directly or if the underlying
implementation does not support this capability.RepositoryException
- if an error occurs trying to locate the
binary.Copyright © 2010 - 2020 Adobe. All Rights Reserved