AssetManager copyAsset method to create version if destination already exist | Adobe Higher Education
Skip to main content
Level 2
October 16, 2015
Risolto

AssetManager copyAsset method to create version if destination already exist

  • October 16, 2015
  • 2 risposte
  • 794 visualizzazioni

Hi,

How I can use copyAsset method to create new version of an asset if  destination asset already exist.

Thanks
LM

Questo argomento è stato chiuso alle risposte.
Migliore risposta di joerghoh

You can use the AssetManager-API to create revisions[1].

kind regards,
Jörg

 

[1] https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/dam/api/AssetManager.html#createRevision(com.day.cq.dam.api.Asset,%20java.lang.String,%20java.lang.String)

2 risposte

smacdonald2008
Level 10
October 16, 2015

Look at this community article:

https://helpx.adobe.com/experience-manager/using/graniteAPI.html

It talks about using the Granite version of AssetManager to move digital assets. Its up to your app logic to name the asset when you move it. For example:

 String assetPath = "/content/dam/testfolder/somefile.pdf";
 String copyPath = "/content/dam/testhtml/copieddoc.pdf";
 assetManager.copyAsset(assetPath, copyPath);

You can check to see if a asset has the name. If so - change the name of the new asset - ie - copieddoc1.pdf.

joerghoh
Adobe Employee
joerghohAdobe EmployeeRisposta
Adobe Employee
October 16, 2015