Package com.adobe.granite.asset.api
Interface AssetMetadata
-
@ProviderType public interface AssetMetadata
AssetMetadata
defines theAsset
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
getProperty(XMPPath path, java.lang.Class<T> type)
Get a simple xmp property value.XMPMetadata
getXMP()
Get XMP.<T> void
setProperty(XMPPath path, T value)
Set a simple XMP property.void
setXMP(XMPMetadata meta, SchemaService schemaService)
Set XMP.void
setXMP(XMPMetadata meta, SchemaService schemaService, java.util.List ignoreHierarchy)
Set XMP.
-
-
-
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 setschemaService
- , optional schema service to be used to persist property types- Throws:
AssetException
- if the given XMP cannot be stored in Assetjava.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 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 Assetjava.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 updatedvalue
- , to be set- Throws:
AssetException
- if property cannot be setjava.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 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 typejava.lang.NullPointerException
- if the given XMPPath is null
-
-