Interface DownloadTargetProcessor
-
@ConsumerType public interface DownloadTargetProcessor
Facilitates the conversion of a
DownloadTarget
to one or more binary URIs.This interface should be implemented to create a handler for a given type of
DownloadTarget
. Any targets whose type match the processor's type will go through the processor implementation when the time comes to translate the target into the binary URIs to be included in a download provided by theDownloadService
.The concept of the processor provides a place where consumers can customize the types of targets that can be included in the download process. See
DownloadService
documentation for examples.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getTargetType()
The target type that the processor handles.java.util.Map<java.lang.String,java.lang.Boolean>
getValidParameters()
Retrieves a map indicating which parameters the processor supports, and whether or not each each parameter is required.java.util.Collection<DownloadFile>
processTarget(DownloadTarget target, ResourceResolver resourceResolver)
Does the work of converting a target into a files that can be included in a download.
-
-
-
Method Detail
-
processTarget
java.util.Collection<DownloadFile> processTarget(DownloadTarget target, ResourceResolver resourceResolver) throws DownloadException
Does the work of converting a target into a files that can be included in a download.
When this method is called, it's assumed that the processors parameters have been validated based on its
getValidParameters()
method.- Parameters:
target
- Item whose parameters can be used by the processor to retrieve binary information.resourceResolver
- Can be used by the processor to look up sling-related information for the target.- Returns:
- List of files for download.
- Throws:
DownloadException
- Thrown if there are issues during the process of processing a target.
-
getTargetType
java.lang.String getTargetType()
The target type that the processor handles.DownloadTarget
items whosetype
matches this value will be passed through the processor'sprocessTarget(DownloadTarget, ResourceResolver)
method.- Returns:
- The type of targets that will be handled by the processor implementation.
-
getValidParameters
java.util.Map<java.lang.String,java.lang.Boolean> getValidParameters()
Retrieves a map indicating which parameters the processor supports, and whether or not each each parameter is required.- Returns:
- A map whose keys are the names of parameters, and whose values indicate if the parameter is required.
-
-