Class ManageImageCache


  • public class ManageImageCache
    extends Object
    Normal image can come from inside system or from outside system. with image from outside for performance we will cache it. this class for manage image cache and provide help function relate
    Author:
    hieplq
    • Field Detail

      • log

        protected static final CLogger log
    • Constructor Detail

      • ManageImageCache

        public ManageImageCache()
    • Method Detail

      • getImageInternalUrl

        public static URL getImageInternalUrl​(MImage image)
        investigate image path of MImage, if path is a internal return internal url other return null
        Parameters:
        image -
        Returns:
      • getImageInternalUrl

        public static URL getImageInternalUrl​(String url)
        investigate image path, if path is a internal return internal url other return null
        Parameters:
        url -
        Returns:
      • loadImageData

        protected static byte[] loadImageData​(String imagePath)
        Load image from url
        Parameters:
        imagePath -
        Returns:
      • getImage

        public org.zkoss.image.Image getImage​(String imagePath)
        if image is don't in cache, load it (imagePath can id of MImage)
        Parameters:
        imagePath -
        Returns:
        image load from path. null when has any exception
      • getImage

        public org.zkoss.image.Image getImage​(URL url)
        Parameters:
        url -
        Returns:
        Image
      • loadImage

        public String loadImage​(MImage mImage)
        if MImage contain extend image or binary image data, load it into cache and return key other return null
        Parameters:
        mImage -
        Returns:
      • loadExtend

        protected void loadExtend​(String imagePath)
        load extend image into cache
        Parameters:
        imagePath -