Package org.opencms.ui.apps.cacheadmin
Class CmsImageCacheHelper
- java.lang.Object
-
- org.opencms.ui.apps.cacheadmin.CmsImageCacheHelper
-
public class CmsImageCacheHelper extends java.lang.Object
Image Cache helper.- Since:
- 7.0.5
-
-
Constructor Summary
Constructors Constructor Description CmsImageCacheHelper(CmsObject cms, boolean withVariations, boolean showSize, boolean statsOnly)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List
getAllCachedImages()
Returns all cached images.int
getFilesCount()
Returns the total number of files.java.lang.String
getLength(java.lang.String imgName)
Returns the length of the given image.java.lang.String
getSingleSize(CmsObject cms, java.lang.String resPath)
Reads the size of a single image.java.lang.String
getSize(java.lang.String imgName)
Returns the size of the given image.java.util.List
getVariations(java.lang.String imgName)
Returns the variations for the given image.int
getVariationsCount()
Returns the total number of variations.int
getVariationsSize()
Returns the total size of all variations.
-
-
-
Constructor Detail
-
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 Detail
-
getAllCachedImages
public java.util.List getAllCachedImages()
Returns all cached images.- Returns:
- a list of root paths
-
getFilesCount
public int getFilesCount()
Returns the total number of files.- Returns:
- the total number of files
-
getLength
public java.lang.String getLength(java.lang.String imgName)
Returns the length of the given image.- Parameters:
imgName
- the image name- Returns:
- the length of the given image
-
getSingleSize
public java.lang.String getSingleSize(CmsObject cms, java.lang.String resPath) throws CmsException
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
public java.lang.String getSize(java.lang.String imgName)
Returns the size of the given image.- Parameters:
imgName
- the image name- Returns:
- the size of the given image
-
getVariations
public java.util.List getVariations(java.lang.String imgName)
Returns the variations for the given image.- Parameters:
imgName
- the image name- Returns:
- the variations for the given image
-
getVariationsCount
public int getVariationsCount()
Returns the total number of variations.- Returns:
- the total number of variations
-
getVariationsSize
public int getVariationsSize()
Returns the total size of all variations.- Returns:
- the total size of all variations
-
-