Class DigitalAsset

All Implemented Interfaces:
Serializable

public class DigitalAsset extends Asset
Representation of a digital asset. This extends Asset but contains some methods and models specific to digital asset. Most methods in this call will only work on full digital assets and not references, so if Asset.isReferenceOnly() returns true will need to get the full Digital asset item to get results from some methods. Even for references, the Asset.getId() field will always be set.
See Also:
  • Field Details

  • Constructor Details

    • DigitalAsset

      public DigitalAsset()
  • Method Details

    • getAssetFields

      public DigitalAssetFields getAssetFields()
      Get the digital asset fields structure, which contains all of metadata/rendition information for the digital asset.
      Returns:
      Digital asset fields
    • isCustomAssetType

      public boolean isCustomAssetType()
    • getCustomFieldFromType

      public <T extends ContentField> T getCustomFieldFromType(String fieldName, FieldType type)
      A generic method that will return the custom digital asset attribute field given the specified type. For example, you could call it like this to get a the field for a content date: ContentFieldDate dateField = item.getFieldFromType("date_field", FieldType.DATE);
      Type Parameters:
      T - the specific ContentField class
      Parameters:
      fieldName - field name to match
      type - The type of field expected
      Returns:
      Specific ContentField derived class or null if it doesn't exist
    • getSize

      public Integer getSize()
      Get size in bytes for this digital asset or null if size not available
      Returns:
      size in bytes or null
    • getVersion

      public String getVersion()
      Get version (if applicable) for the item/asset as a string.
      Returns:
      Version for the item (may be null)
    • isImage

      public Boolean isImage()
      Does this refer to an image? If it's not known whether this is an image because this is only an item reference, it will return null.
      Returns:
      true if image reference or null if not known
    • getNativeDownloadUrl

      public String getNativeDownloadUrl()
      Get the fully qualified url to download the 'native' digital asset. This will return null if this is a reference and not a full digital asset.
      Returns:
      Fully qualified url which can be used to download the asset.
    • getRenditionUrl

      public String getRenditionUrl(String rendition)
      In general use getRenditionUrl(RenditionType) unless you are trying to get the name of a custom rendition in which case you can use this method to pass in the raw rendition name.
      Parameters:
      rendition - the rendition name
      Returns:
      The matching rendition url or null if no match
    • getRendition

      public DigitalAssetRendition getRendition(String rendition)
      Get the fully qualified url for the given rendition type, which could be native. If this returns null, the full digital asset properties have not been retrieved or there is no matching rendition.
      Parameters:
      rendition - The desired RenditionType
      Returns:
      The matching rendition url or null if no match
    • getRenditionUrl

      public String getRenditionUrl(RenditionType rendition)
      Get the fully qualified url for the given rendition type, which could be native. If this returns null, the full digital asset properties have not been retrieved or there is no matching rendition.
      Parameters:
      rendition - The desired RenditionType
      Returns:
      The matching rendition url or null if no match
    • getRenditionsList

      public List<DigitalAssetRendition> getRenditionsList()
      Get full list of renditions available in the digital asset or null if not available.
      Returns:
      list of renditions
    • getPreferredRendition

      public DigitalAssetRendition.RenditionFormat getPreferredRendition(DigitalAssetPreferredRenditionCriteria renditionCriteria)
      Will search through the renditions to find a matching rendition based on DigitalAssetPreferredRenditionCriteria. This is a convenience method to assist in finding a rendition based on specific criteria. If a RenditionFormat is returned, call DigitalAssetRendition.RenditionFormat.getDownloadUrl() to get the url to use for download.
      Parameters:
      renditionCriteria - criteria for finding a rendition
      Returns:
      the best matching DigitalAssetRendition.RenditionFormat or null if no renditions
    • getAdvancedVideoInfo

      public AdvancedVideoInfo getAdvancedVideoInfo()
    • getAdvancedVideoInfoProperties

      public AdvancedVideoInfoProperties getAdvancedVideoInfoProperties()
    • getVideoToken

      public String getVideoToken()
    • isAdvancedVideo

      public boolean isAdvancedVideo()