Package io.wcm.handler.media
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.ModificationDateProviderRepresents a rendition contained in aAssetwhich 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 Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description @Nullable StringgetFileExtension()@Nullable StringgetFileName()longgetFileSize()longgetHeight()Gets the height of this rendition.@Nullable MediaFormatgetMediaFormat()@Nullable StringgetMimeType()@Nullable DategetModificationDate()@Nullable StringgetPath()Returns the internal path of the rendition if stored within the JCR repository.@NotNull org.apache.sling.api.resource.ValueMapgetProperties()default doublegetRatio()Gets the ratio of the image (width / height).@Nullable StringgetUrl()Get externalized URL pointing to the rendition.longgetWidth()Gets the width of this rendition.booleanisBrowserImage()booleanisDownload()booleanisFlash()Deprecated.Flash support is deprecatedbooleanisImage()booleanisVectorImage()
-
-
-
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:
getModificationDatein interfaceio.wcm.wcm.commons.caching.ModificationDateProvider- Returns:
- The date of the last modification
-
-