Interface Rendition

  • All Superinterfaces:
    org.apache.sling.api.adapter.Adaptable, io.wcm.wcm.commons.caching.ModificationDateProvider

    @ProviderType
    public interface Rendition
    extends org.apache.sling.api.adapter.Adaptable, io.wcm.wcm.commons.caching.ModificationDateProvider
    Represents a rendition contained in a Asset which can be rendered. A rendition can be pointing to a binary file stored in the repository, or a virtual rendition that is rendered on the fly if required.
    • Method Detail

      • getUrl

        @Nullable
        @Nullable String getUrl()
        Get externalized URL pointing to the rendition.
        Returns:
        Rendition URL
      • getPath

        @Nullable
        @Nullable String getPath()
        Returns the internal path of the rendition if stored within the JCR repository. If the rendition is a virtual rendition the path points to the binary from which the virtual rendition is derived from.
        Returns:
        Repository path
      • getFileName

        @Nullable
        @Nullable String getFileName()
        Returns:
        File name of the renditions source binary
      • getFileExtension

        @Nullable
        @Nullable String getFileExtension()
        Returns:
        File extension of the renditions source binary
      • getFileSize

        long getFileSize()
        Returns:
        File size of the rendition in bytes (or -1 if it is unknown).
      • getMimeType

        @Nullable
        @Nullable String getMimeType()
        Returns:
        Mime type of the renditions source binary.
      • getMediaFormat

        @Nullable
        @Nullable MediaFormat getMediaFormat()
        Returns:
        Media format that matches with the resolved rendition. Null if no media format was specified for resolving.
      • getProperties

        @NotNull
        @NotNull org.apache.sling.api.resource.ValueMap getProperties()
        Returns:
        Properties of rendition
      • isImage

        boolean isImage()
        Returns:
        true if the rendition is an image format supported by the media handler.
      • isBrowserImage

        boolean isBrowserImage()
        Returns:
        true if the rendition is a web image file that can be displayed in a browser.
      • isVectorImage

        boolean isVectorImage()
        Returns:
        true if the rendition is a vector image that can be displayed in a browser.
      • isFlash

        @Deprecated
        boolean isFlash()
        Deprecated.
        Flash support is deprecated
        Returns:
        true if the rendition has a flash movie.
      • isDownload

        boolean isDownload()
        Returns:
        true if the rendition is not and image nor a flash movie.
      • getWidth

        long getWidth()
        Gets the width of this rendition. If it is a virtual rendition the virtual height is returned.
        Returns:
        Height in pixels. Returns 0 if no height information is available.
      • getHeight

        long getHeight()
        Gets the height of this rendition. If it is a virtual rendition the virtual height is returned.
        Returns:
        Height in pixels. Returns 0 if no height information is available.
      • getRatio

        default double getRatio()
        Gets the ratio of the image (width / height).
        Returns:
        Ratio. Returns 0 if no width or height information is available.
      • getModificationDate

        @Nullable
        @Nullable Date getModificationDate()
        Specified by:
        getModificationDate in interface io.wcm.wcm.commons.caching.ModificationDateProvider
        Returns:
        The date of the last modification