Package com.adobe.granite.asset.api
Interface AssetVersionManager
AssetVersionManager provides methods to manage AssetVersions.
AssetVersionManager is created by adapting ResourceResolver
to AssetVersionManager
AssetVersionManager versionManager = resolver.adaptTo(AssetVersionManager.class);
-
Method Summary
Modifier and TypeMethodDescriptioncreateVersion(String assetPath, String label) Creates a new version of anAsset.getVersion(String versionId) Returns anAssetVersioncorresponding to the given versionId.Iterator<? extends AssetVersion> listVersions(String assetPath) Lists all available versions at the given path.Restores anAsset.
-
Method Details
-
createVersion
Creates a new version of anAsset.- Parameters:
assetPath- Absolute path of the asset to versionlabel- Version label to be added to the newly created version- Returns:
- The newly created AssetVersion
- Throws:
AssetException- if version cannot be created.
-
restore
Restores anAsset.- Parameters:
versionId- version ID to be restored- Returns:
- the restored
Asset - Throws:
AssetException- if version with the given ID cannot be restored
-
getVersion
Returns anAssetVersioncorresponding to the given versionId.- Parameters:
versionId- version ID to be looked up- Returns:
- the AssetVersion matching the given versionId
-
listVersions
Lists all available versions at the given path.- Parameters:
assetPath- Absolute path of the Asset- Returns:
- all
AssetVersions of the given path or an empty iterator if no version has been created yet - Throws:
AssetException- if versions cannot be retrieved for the given Asset path
-