Package com.adobe.granite.asset.api
Interface AssetVersionManager
-
@ProviderType public interface AssetVersionManagerAssetVersionManagerprovides 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(java.lang.String assetPath, java.lang.String label)Creates a new version of anAsset.AssetVersiongetVersion(java.lang.String versionId)Returns anAssetVersioncorresponding to the given versionId.java.util.Iterator<? extends AssetVersion>listVersions(java.lang.String assetPath)Lists all available versions at the given path.Assetrestore(java.lang.String versionId)Restores anAsset.
-
-
-
Method Detail
-
createVersion
AssetVersion createVersion(java.lang.String assetPath, java.lang.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(java.lang.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(java.lang.String versionId)
Returns anAssetVersioncorresponding to the given versionId.- Parameters:
versionId- version ID to be looked up- Returns:
- the AssetVersion matching the given versionId
-
listVersions
java.util.Iterator<? extends AssetVersion> listVersions(java.lang.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
-
-