Compare Sizes Of Assets | Community
Skip to main content
Level 5
April 16, 2018
Solved

Compare Sizes Of Assets

  • April 16, 2018
  • 1 reply
  • 2704 views

Hi,

I want to compare the size of asset as below :

AssetDetails asset = new AssetDetails(assetResource);

if(asset.getSize() < 200KB) {

     // Do Something

}

As size returns string, so can't use this syntax. Any idea to compare the size of assets in AEM?

Thanks,

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 Rima_Mittal

asset.getOriginal.getsize() returns long, maybe that can help.

Asset API Asset ("The Adobe AEM Quickstart and Web Application.")

Rendition API Rendition ("The Adobe AEM Quickstart and Web Application.")

1 reply

Rima_Mittal
Rima_MittalAccepted solution
Level 4
May 2, 2018

asset.getOriginal.getsize() returns long, maybe that can help.

Asset API Asset ("The Adobe AEM Quickstart and Web Application.")

Rendition API Rendition ("The Adobe AEM Quickstart and Web Application.")