Package com.adobe.granite.asset.api
Interface AssetVersion
-
- All Superinterfaces:
Adaptable
@ProviderType public interface AssetVersion extends Adaptable
AssetVersionrepresents a particular version of anAsset.AssetVersion is created by
AssetVersionManagerand retrieved viaAssetVersionManager.getVersion(String).eg: // to create a version AssetVersionManager versionManager = resolver.adaptTo(AssetVersionManager.class); AssetVersion version = versionManager.createVersion("/path/to/asset/document.pdf", "Some label"); // to get existing versions Iterator<AssetVersion> versions = versionManager.listVersions("/path/to/asset/document.pdf"); ...Implementor's Note: Implementations are required to provide an adapter to a read only
ValueMap- See Also:
AssetVersionManager,ValueMap
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetAssetPath()Get path of the parent asset.java.util.CalendargetCreated()Get the creation date of this version.java.lang.StringgetId()Return the unique version id.java.lang.String[]getLabels()Returns all labels of this version.java.lang.StringgetName()Get name of this version.java.lang.StringgetPath()Get path of this versionRenditiongetRendition(java.lang.String name)Returns a namedRenditionif available.java.util.Iterator<Asset>listRelated(java.lang.String name)Get all related Asset with the given name.java.util.Iterator<AssetRelation>listRelations(java.lang.String name)Get asset relations for a given relation name.java.util.Iterator<? extends Rendition>listRenditions()Returns an iterator for allRenditions of this asset version.
-
-
-
Method Detail
-
getLabels
java.lang.String[] getLabels()
Returns all labels of this version.- Returns:
- version labels or an empty array if there are none.
-
getId
java.lang.String getId()
Return the unique version id.- Returns:
- version id
-
getPath
java.lang.String getPath()
Get path of this version- Returns:
- Version path
-
getAssetPath
java.lang.String getAssetPath()
Get path of the parent asset.- Returns:
- Asset path
-
getName
java.lang.String getName()
Get name of this version.- Returns:
- name
-
getCreated
java.util.Calendar getCreated()
Get the creation date of this version.- Returns:
- creation date
-
getRendition
Rendition getRendition(java.lang.String name)
Returns a namedRenditionif available.- Parameters:
name- Rendition name to search- Returns:
- rendition or null if not found
- Throws:
AssetException- If an error occurs trying to load the Rendition object
-
listRenditions
java.util.Iterator<? extends Rendition> listRenditions()
Returns an iterator for allRenditions of this asset version.- Returns:
- The Iterator of renditions or an empty iterator if no renditions has been created.
-
listRelated
java.util.Iterator<Asset> listRelated(java.lang.String name)
Get all related Asset with the given name.- Parameters:
name- of the relation- Returns:
- Iterator of related Assets or an empty iterator if relations cannot be found with the given name.
-
listRelations
java.util.Iterator<AssetRelation> listRelations(java.lang.String name)
Get asset relations for a given relation name.- Parameters:
name- Name of the relation- Returns:
- Iterator of
AssetRelationor an empty iterator if relations cannot be found with the given name.
-
-