Hello All,
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);