Interface Rendition

  • All Superinterfaces:
    Adaptable, Resource
    All Known Subinterfaces:

    public interface Rendition
    extends Resource
    Rendition is a read only representation of a particular rendition of an Asset.

    Rendition is an extension of a Sling Resource, therefore its adaptable.

    Rendition is created by Asset.setRendition(String,, java.util.Map) and can be retrieved either via Asset.getRendition(String) or by adapting a rendition Resource to a Rendition type.

         // to create a rendition
         AssetManager assetManager = resolver.adaptTo(AssetManager.class);
         Asset asset = assetManager.getAsset("/path/to/asset/document.pdf");
         asset.setRendition("thumbnail.jpg",, java.util.Map);
         // to get rendition
         Rendition rendition = asset.getRendition("thumbnail.jpg");
         // to get rendition by adapting
         Rendition rendition = resource.adaptTo(Rendition.class);
    • Method Detail

      • getMimeType

        String getMimeType()
        Returns the mime type of the rendition's binary.
        the mime type
      • getSize

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

        InputStream getStream()
        Returns the InputStream representing the binary of this rendition.
        The input stream of the rendition's binary, or null if the binary is not found.
        AssetIOException - if stream cannot be read