Package org.adempiere.webui.util
Class ManageImageCache
- java.lang.Object
-
- org.adempiere.webui.util.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
-
-
Constructor Summary
Constructors Constructor Description ManageImageCache()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.zkoss.image.Image
getImage(String imagePath)
if image is don't in cache, load it (imagePath can id of MImage)org.zkoss.image.Image
getImage(URL url)
static URL
getImageInternalUrl(String url)
investigate image path, if path is a internal return internal url other return nullstatic URL
getImageInternalUrl(MImage image)
investigate image path of MImage, if path is a internal return internal url other return nullstatic ManageImageCache
instance()
get instanceprotected void
loadExtend(String imagePath)
load extend image into cacheString
loadImage(MImage mImage)
if MImage contain extend image or binary image data, load it into cache and return key other return nullprotected static byte[]
loadImageData(String imagePath)
Load image from url
-
-
-
Field Detail
-
log
protected static final CLogger log
-
-
Method Detail
-
instance
public static ManageImageCache instance()
get instance- Returns:
-
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
-
-
-