Package com.adobe.cq.dam.download.api
Interface DownloadFile
Represents a repository file whose binary contents can be included in a download
artifact. This is the result of converting a DownloadTarget into one or
more files by a DownloadTargetProcessor.
In addition to some common values, the interface provides the ability to specify additional parameters in the form of name value pairs.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves a URI to the file's binary.<T> TgetParameter(String parameterName, Class<T> clazz) Retrieves one of the file's parameters by name.<T> TgetParameter(String parameterName, T defaultValue) Retrieves one of the file's parameters by name.String[]Retrieves the names of all parameters included in the file.getSize()Retrieves the size of the file, in bytes.
-
Method Details
-
getSize
Retrieves the size of the file, in bytes.- Returns:
- Byte size.
-
getBinaryURI
URI getBinaryURI()Retrieves a URI to the file's binary. Should be accessible to the service being used to generate the archive.- Returns:
- URI to a binary.
-
getParameter
Retrieves one of the file's parameters by name. The value will be converted to the specified type.- Type Parameters:
T- Target type for the parameter value.- Parameters:
parameterName- The name of the parameter whose value to retrieve.clazz- The type to which that the parameter's value will be converted.- Returns:
- The given parameter's value.
-
getParameter
Retrieves one of the file's parameters by name. If the parameter doesn't have a value then the method will return the given default value instead. The parameter value will be converted to the specified type.- Type Parameters:
T- Target type for the parameter value.- Parameters:
parameterName- The name of the parameter whose value to retrieve.defaultValue- Value to return if the parameter has no value.- Returns:
- The given parameter's value, or the given defalt value.
-
getParameterNames
String[] getParameterNames()Retrieves the names of all parameters included in the file.- Returns:
- Parameter names.
-