Create Asset method of Asset Manager is deprecated | Community
Skip to main content
Level 2
November 29, 2023
Solved

Create Asset method of Asset Manager is deprecated

  • November 29, 2023
  • 1 reply
  • 2260 views
Hello All,
 
I have created an asset in my servlet using Asset Manager's createAsset method but it was deprecated. I searched on community regarding this I found the solution on this https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-assets/correct-api-to-create-asset-in-aem-programmatically-as/m-p/437003#M2090 .
In solution, he has suggested to use createOrReplaceAsset method but this method was also deprecated. I had gone through all the methods of Asset Manager, there are almost all the methods are deprecated.
Can anyone suggest me which method I have to use to create asset from backend using Asset Manager or else any different approach rather than Asset Manager.

Sample Code:
AssetManager assetManager = resolver.adaptTo(AssetManager.class);
File file = new File("/home/root322/Pictures/myPics");
InputStream targetStream = new FileInputStream(file);
assetManager.createAsset("/content/dam/aem-site/myPics", targetStream,null,true);
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by EstebanBustamante

Hi,

 

Please check this option, https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/developer-reference-material-apis.html?lang=en  it seems this is the preferred way now to upload assets.

 

Hope this helps.

1 reply

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
November 29, 2023

Hi,

 

Please check this option, https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/developer-reference-material-apis.html?lang=en  it seems this is the preferred way now to upload assets.

 

Hope this helps.

Esteban Bustamante