Compare Sizes Of Assets

Avatar

Avatar
Validate 25
Level 3
vdhim23
Level 3

Like

1 like

Total Posts

135 posts

Correct reply

9 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
Level 3
vdhim23
Level 3

Like

1 like

Total Posts

135 posts

Correct reply

9 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
vdhim23
Level 3

16-04-2018

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,

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 4
Rima_Mittal
Level 4

Likes

30 likes

Total Posts

82 posts

Correct reply

17 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
Rima_Mittal
Level 4

Likes

30 likes

Total Posts

82 posts

Correct reply

17 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
Rima_Mittal
Level 4

02-05-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.")

Answers (0)