Hello,
I am creating a Java servlet to download assets. If this is static rendition such as cq5dam.web.1280.1280.jpeg, I can call asset method to do that as below:
Resource resource = resolver.getResource(assetPath);
Asset asset = resource.adaptTo(Asset.class);
InputStream is = asset.getRendition("cq5dam.web.1280.1280.jpeg").getStream();
But for dynamic rendition, it doesn't work. How can I get stream for dynamic rendition? Your input would be appreciated.
Solved! Go to Solution.
Views
Replies
Total Likes
you can try like this
List<Rendition> renditions = asset.getRenditions();
for (Rendition rendition : renditions) {
<<< --- each asset rendition -- get stream >>
}
}
you can try like this
List<Rendition> renditions = asset.getRenditions();
for (Rendition rendition : renditions) {
<<< --- each asset rendition -- get stream >>
}
}
Views
Replies
Total Likes