Class CmsImageCacheHelper

java.lang.Object
org.opencms.ui.apps.cacheadmin.CmsImageCacheHelper

public class CmsImageCacheHelper extends Object
Image Cache helper.

Since:
7.0.5
  • Constructor Details

    • CmsImageCacheHelper

      public CmsImageCacheHelper(CmsObject cms, boolean withVariations, boolean showSize, boolean statsOnly)
      Default constructor.

      Parameters:
      cms - the cms context
      withVariations - if also variations should be read
      showSize - if it is needed to compute the image size
      statsOnly - if only statistical information should be retrieved
  • Method Details

    • 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 String getLength(String imgName)
      Returns the length of the given image.

      Parameters:
      imgName - the image name
      Returns:
      the length of the given image
    • getSingleSize

      public String getSingleSize(CmsObject cms, String resPath) throws CmsException
      Reads the size of a single image.

      Parameters:
      cms - CmsObejct
      resPath - Path of image (uri)
      Returns:
      a String representation of the dimension of the given image
      Throws:
      CmsException - if something goes wrong
    • getSize

      public String getSize(String imgName)
      Returns the size of the given image.

      Parameters:
      imgName - the image name
      Returns:
      the size of the given image
    • getVariations

      public List getVariations(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