Package com.adobe.granite.asset.api
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 Summary
Modifier and TypeMethodDescription<T> TgetProperty(XMPPath path, Class<T> type) Get a simple xmp property value.getXMP()Get XMP.<T> voidsetProperty(XMPPath path, T value) Set a simple XMP property.voidsetXMP(XMPMetadata meta, SchemaService schemaService) Set XMP.voidsetXMP(XMPMetadata meta, SchemaService schemaService, List ignoreHierarchy) Set XMP.
-
Method Details
-
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
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 setschemaService- , optional schema service to be used to persist property types- Throws:
AssetException- if the given XMP cannot be stored in AssetNullPointerException- if the given XMPMetadata is null
-
setXMP
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 setschemaService- , optional schema service to be used to persist property typesignoreHierarchy- , list of nodes for which hierarchy needs to be ignored- Throws:
AssetException- if the given XMP cannot be stored in AssetNullPointerException- if the given XMPMetadata is null
-
setProperty
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 updatedvalue- , to be set- Throws:
AssetException- if property cannot be setNullPointerException- if the given XMPPath is null
-
getProperty
Get a simple xmp property value.This method supports String, Calendar, Long, BigDecimal & Boolean
- Type Parameters:
T- the type- Parameters:
path- , XMP pathtype- , 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 typeNullPointerException- if the given XMPPath is null
-