Package com.adobe.granite.asset.api
Interface AssetVersionManager
-
@ProviderType public interface AssetVersionManager
AssetVersionManager
provides methods to manageAssetVersion
s.AssetVersionManager is created by adapting
ResourceResolver
toAssetVersionManager
AssetVersionManager versionManager = resolver.adaptTo(AssetVersionManager.class);
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AssetVersion
createVersion(java.lang.String assetPath, java.lang.String label)
Creates a new version of anAsset
.AssetVersion
getVersion(java.lang.String versionId)
Returns anAssetVersion
corresponding to the given versionId.java.util.Iterator<? extends AssetVersion>
listVersions(java.lang.String assetPath)
Lists all available versions at the given path.Asset
restore(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 anAssetVersion
corresponding 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
AssetVersion
s 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
-
-