Package com.adobe.cq.dam.download.api
Interface DownloadApiFactory
-
@ProviderType public interface DownloadApiFactory
Factory interface for creating various objects whose implementations depend on the type of service being implemented.
Implementers of custom
DownloadService
implementations should implement this interface to return dependencies whose types are applicable to the custom service.- See Also:
DownloadService
,DownloadManifest
,DownloadFile
,DownloadTarget
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DownloadFile
createDownloadFile(java.util.Optional<java.lang.Long> size, java.net.URI binaryURI, java.util.Map<java.lang.String,java.lang.Object> parameters)
Creates a new instance for use with aDownloadTargetProcessor
.DownloadManifest
createDownloadManifest()
Creates a new manifest instance for use with theDownloadService
.DownloadTarget
createDownloadTarget(java.lang.String targetType, java.util.Map<java.lang.String,java.lang.Object> parameters)
Creates a new instance for use with aDownloadManifest
.DownloadFile
createFailedDownloadFile(java.lang.String failureReason, java.util.Map<java.lang.String,java.lang.Object> parameters)
Creates a representation of a failed download file.
-
-
-
Method Detail
-
createDownloadManifest
DownloadManifest createDownloadManifest()
Creates a new manifest instance for use with theDownloadService
.- Returns:
- An empty manifest.
-
createDownloadFile
DownloadFile createDownloadFile(java.util.Optional<java.lang.Long> size, java.net.URI binaryURI, java.util.Map<java.lang.String,java.lang.Object> parameters)
Creates a new instance for use with aDownloadTargetProcessor
.- Parameters:
size
- The size, in bytes, of the file.binaryURI
- URI to the file's binary data.parameters
- Additional data to include with the file.- Returns:
- An initialized instance that uses the provided values.
-
createFailedDownloadFile
DownloadFile createFailedDownloadFile(java.lang.String failureReason, java.util.Map<java.lang.String,java.lang.Object> parameters)
Creates a representation of a failed download file.- Parameters:
failureReason
- The reason this download file should be considered failed.parameters
- Additional data to include with the file.- Returns:
- An initialized instance that uses the provided values.
-
createDownloadTarget
DownloadTarget createDownloadTarget(java.lang.String targetType, java.util.Map<java.lang.String,java.lang.Object> parameters)
Creates a new instance for use with aDownloadManifest
.- Parameters:
targetType
- The target'sDownloadTarget.getType()
value.parameters
- Parameters to be retrieved using the target's getParameter() methods.- Returns:
- An initialized target instance that uses the provided values.
-
-