Package org.opencms.ui.apps.cacheadmin
Class CmsImageCacheHelper
java.lang.Object
org.opencms.ui.apps.cacheadmin.CmsImageCacheHelper
Image Cache helper.
- Since:
- 7.0.5
-
Constructor Summary
ConstructorDescriptionCmsImageCacheHelper
(CmsObject cms, boolean withVariations, boolean showSize, boolean statsOnly) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns all cached images.int
Returns the total number of files.Returns the length of the given image.getSingleSize
(CmsObject cms, String resPath) Reads the size of a single image.Returns the size of the given image.getVariations
(String imgName) Returns the variations for the given image.int
Returns the total number of variations.int
Returns the total size of all variations.
-
Constructor Details
-
CmsImageCacheHelper
public CmsImageCacheHelper(CmsObject cms, boolean withVariations, boolean showSize, boolean statsOnly) Default constructor.- Parameters:
cms
- the cms contextwithVariations
- if also variations should be readshowSize
- if it is needed to compute the image sizestatsOnly
- if only statistical information should be retrieved
-
-
Method Details
-
getAllCachedImages
Returns all cached images.- Returns:
- a list of root paths
-
getFilesCount
Returns the total number of files.- Returns:
- the total number of files
-
getLength
Returns the length of the given image.- Parameters:
imgName
- the image name- Returns:
- the length of the given image
-
getSingleSize
Reads the size of a single image.- Parameters:
cms
- CmsObejctresPath
- Path of image (uri)- Returns:
- a String representation of the dimension of the given image
- Throws:
CmsException
- if something goes wrong
-
getSize
Returns the size of the given image.- Parameters:
imgName
- the image name- Returns:
- the size of the given image
-
getVariations
Returns the variations for the given image.- Parameters:
imgName
- the image name- Returns:
- the variations for the given image
-
getVariationsCount
Returns the total number of variations.- Returns:
- the total number of variations
-
getVariationsSize
Returns the total size of all variations.- Returns:
- the total size of all variations
-