Package com.adobe.granite.asset.api
Interface AssetVersionManager
-
@ProviderType public interface AssetVersionManager
AssetVersionManagerprovides methods to manageAssetVersions.AssetVersionManager is created by adapting
ResourceResolvertoAssetVersionManagerAssetVersionManager versionManager = resolver.adaptTo(AssetVersionManager.class);
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AssetVersioncreateVersion(String assetPath, String label)Creates a new version of anAsset.AssetVersiongetVersion(String versionId)Returns anAssetVersioncorresponding to the given versionId.Iterator<? extends AssetVersion>listVersions(String assetPath)Lists all available versions at the given path.Assetrestore(String versionId)Restores anAsset.
-
-
-
Method Detail
-
createVersion
AssetVersion createVersion(String assetPath, String label)
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
Asset restore(String versionId)
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
AssetVersion getVersion(String versionId)
Returns anAssetVersioncorresponding to the given versionId.- Parameters:
versionId- version ID to be looked up- Returns:
- the AssetVersion matching the given versionId
-
listVersions
Iterator<? extends AssetVersion> listVersions(String assetPath)
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
-
-