Interface AssetMetadata


  • @ProviderType
    public interface AssetMetadata
    AssetMetadata defines the Asset metadata.

    To get AssetMetadata, use Asset.getAssetMetadata()

    
     Example:
    
     Asset asset = assetManager.getAsset("/path/to/asset/document.pdf");
    
     // get metadata
     AssetMetadata assetMetadata = asset.getAssetMetadata();
    
     
    • Method Detail

      • getXMP

        XMPMetadata getXMP()
        Get XMP. An empty XMPMetadata object is returned if there is no existing metadata
        Returns:
        XMP metadata object
        Throws:
        AssetException - If an error occurs trying to load the XMPMetadata object
      • setXMP

        void setXMP​(XMPMetadata meta,
                    SchemaService schemaService)
        Set XMP. This method will replace any existing XMP previously stored.

        To update existing XMP data, either use #setProperty or #getXMP- update the resulting object and #setXMP

        Parameters:
        meta - , XMP metadata object to be set
        schemaService - , optional schema service to be used to persist property types
        Throws:
        AssetException - if the given XMP cannot be stored in Asset
        java.lang.NullPointerException - if the given XMPMetadata is null
      • setXMP

        void setXMP​(XMPMetadata meta,
                    SchemaService schemaService,
                    java.util.List ignoreHierarchy)
        Set XMP. This method will replace any existing XMP previously stored.

        To update existing XMP data, either use #setProperty or #getXMP- update the resulting object and #setXMP.

        ignoreHierarchy parameter defines a list of fully qualified xmp node names for which qualifiers and language alternatives needs to be ignored.

        Parameters:
        meta - , XMP metadata object to be set
        schemaService - , optional schema service to be used to persist property types
        ignoreHierarchy - , list of nodes for which hierarchy needs to be ignored
        Throws:
        AssetException - if the given XMP cannot be stored in Asset
        java.lang.NullPointerException - if the given XMPMetadata is null
      • setProperty

        <T> void setProperty​(XMPPath path,
                             T value)
        Set a simple XMP property. If there is no property found at the given path, a new property is created, otherwise value is updated.

        This method supports String, Calendar, Long, BigDecimal & Boolean

        Type Parameters:
        T - the type of the value
        Parameters:
        path - , XMP path including the property name which needs to be updated
        value - , to be set
        Throws:
        AssetException - if property cannot be set
        java.lang.NullPointerException - if the given XMPPath is null
      • getProperty

        <T> T getProperty​(XMPPath path,
                          java.lang.Class<T> type)
        Get a simple xmp property value.

        This method supports String, Calendar, Long, BigDecimal & Boolean

        Type Parameters:
        T - the type
        Parameters:
        path - , XMP path
        type - , type of the value expected
        Returns:
        property value or null if the property does not exist
        Throws:
        AssetException - if property cannot be read or typed to a requested type
        java.lang.NullPointerException - if the given XMPPath is null