ResourceResolver resourceResolver = resResolverFactory.getAdministrativeResourceResolver(null); inStream = new FileInputStream(assetPath); Session session=resourceResolver.adaptTo(Session.class); BufferedInputStream stream = new BufferedInputStream(inStream); AssetManager manager = resourceResolver.adaptTo(AssetManager.class); log.info("finished"); manager.createAsset(destPath, inStream, "image/jpeg", true); session.save(); session.logout();
in above code getting null pointer at AssetManager
how to initialize assetmanget inside service and sheduler
Views
Replies
Total Likes
TO learn how to work with AssetManager API to upload assets -- see this AEM community article:
https://helpx.adobe.com/experience-manager/using/uploading-files-aem1.html
Hope this helps
Views
Replies
Total Likes
As mentioned by Scott, please refer to the community article.
Link:- https://helpx.adobe.com/experience-manager/using/uploading-files-aem1.html
This article helps us to create an AEM application that lets users select image files and upload them to a Java Sling Servlet. Once uploaded, the Servlet uses the AssetManager API to store the image file in the Adobe CQ DAM
Demo package :- https://helpx.adobe.com/content/help/en/experience-manager/using/uploading-files-aem1/_jcr_content/m...
I hope this would work for you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes