Class CmsImageCacheHelper

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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 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 - 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 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