Package com.adobe.granite.asset.api
Interface RenditionHandler
-
@ConsumerType public interface RenditionHandler
TheRenditionHandler
interface defines the API for rendition handlers. Each RenditionHandler must be identifiable via a unique ID 'rendition.handler.id'.RenditionHandler is used by the Asset API to delegate Access, Creation & Deletion of
Rendition
.Implementations of this interface must be registered as OSGi services.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_ID
PROPERTY_ID must be set by the implementation class as an OSGi service property This is used by the Asset API to identify RenditionHandlerstatic java.lang.String
PROPERTY_RENDITION_MIME_TYPE
This property constant defines a property key for the mime type.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteRendition(Resource resource)
Delete the rendition resource.Rendition
getRendition(Resource resource)
Get Rendition.Rendition
setRendition(Resource resource, java.io.InputStream is, java.util.Map<java.lang.String,java.lang.Object> map)
SetRendition
.
-
-
-
Field Detail
-
PROPERTY_ID
static final java.lang.String PROPERTY_ID
PROPERTY_ID must be set by the implementation class as an OSGi service property This is used by the Asset API to identify RenditionHandler- See Also:
- Constant Field Values
-
PROPERTY_RENDITION_MIME_TYPE
static final java.lang.String PROPERTY_RENDITION_MIME_TYPE
This property constant defines a property key for the mime type. This can be used by theRenditionHandler
or the API clients to define the mime type of the RenditionFor example, if the rendition handler requires mime type: final Map<String, Object> map = new HashMap<String, Object>(); map.put(RenditionHandler.PROPERTY_RENDITION_MIME_TYPE, "image/gif"); .... asset.setRendition("image.gif", InputStream, map);
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRendition
Rendition getRendition(Resource resource)
Get Rendition. Implementations are expected to type the givenResource
to Rendition.- Parameters:
resource
- Rendition resource- Returns:
- Rendition object of the given resource
-
setRendition
Rendition setRendition(Resource resource, java.io.InputStream is, java.util.Map<java.lang.String,java.lang.Object> map)
SetRendition
. Implementations are free to define Resource data structure.- Parameters:
resource
- Rendition resourceis
- InputStream to create the rendition binary or nullmap
- containing values needed by this handler.- Returns:
- newly created or updated rendition
- Throws:
AssetException
- if Rendition cannot be set
-
deleteRendition
void deleteRendition(Resource resource)
Delete the rendition resource. Implementations are free to decide the semantics of deletion.- Parameters:
resource
- To be deleted- Throws:
AssetException
- if Rendition cannot be deleted
-
-