com.day.cq.dam.api
Interface Rendition

All Superinterfaces:
Adaptable, Resource

public interface Rendition
extends Resource

The Rendition interface specifies the handling of an Asset's rendition. Renditions are based on the renditions found in the asset's rendition folder (./jcr:content/renditions). Such renditions are based on nodes of type nt:file.


Field Summary
 
Fields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING
 
Method Summary
 Asset getAsset()
          Returns this rendition's parent Asset.
 String getMimeType()
          Returns the mime type of the rendition's binary, as denoted by its jcr:mimeType property.
 String getName()
          Returns the name of the rendition.
 String getPath()
          Returns the path of the rendition, e.g.
 ValueMap getProperties()
          Returns the ValueMap of the rendition's underlying .
 long getSize()
          Returns the size in bytes of the rendition's binary.
 InputStream getStream()
          Returns the InputStream representing the binary of this rendition.
 
Methods inherited from interface org.apache.sling.api.resource.Resource
getChild, getChildren, getParent, getResourceMetadata, getResourceResolver, getResourceSuperType, getResourceType, isResourceType, listChildren
 
Methods inherited from interface org.apache.sling.api.adapter.Adaptable
adaptTo
 

Method Detail

getMimeType

String getMimeType()
Returns the mime type of the rendition's binary, as denoted by its jcr:mimeType property.

Returns:
The mime type of the rendition's binary.

getName

String getName()
Returns the name of the rendition. The name corresponds to the node name underlying the rendition, e.g. ./jcr:content/renditions/myrendition gives a name of myrendition

Specified by:
getName in interface Resource
Returns:
The name of the rendition.

getPath

String getPath()
Returns the path of the rendition, e.g. /content/dam/myasset/jcr:content/renditions/myrendition.

Specified by:
getPath in interface Resource
Returns:
The path of the rendition.

getProperties

ValueMap getProperties()
Returns the ValueMap of the rendition's underlying ./jcr:content node.

Returns:
The content properties.

getSize

long getSize()
Returns the size in bytes of the rendition's binary.

Returns:
The size.

getStream

InputStream getStream()
Returns the InputStream representing the binary of this rendition. Alternatively the stream can be obtained by adapting the rendition:
    ...
    final Rendition rendition = asset.getRendition("myrendition");
    final InputStream stream = rendition.adaptTo(InputStream.class);
    ...
 

Returns:
The input stream of the rendition's binary, or null if the binary is not found.

getAsset

Asset getAsset()
Returns this rendition's parent Asset.

Returns:
The Asset this rendition belongs to.


Copyright © 2011-2013 Adobe Systems Incorporated. All Rights Reserved.