|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.services.imaging.MCRImgCacheManager
public class MCRImgCacheManager
The MCRImgCacheManager deliver the method for getting data into and out of
the cache structure which lies in the IFS.
The cache structure is just an one level flat tree:
|--> [imgCache] --> [cached Image File] --> [versions of image]
Cached image file is a subfolder of the root node imgCache in IFS. The name
is composed the following:
ownerID + absolute path + filename
in absolute path the "/" is replaced by "%20"
| Field Summary | |
|---|---|
static String |
CACHE
|
static String |
CACHE_FOLDER
|
static String |
ORIG
|
static String |
THUMB
|
| Method Summary | |
|---|---|
void |
deleteCache()
|
void |
deleteImage(MCRFile image)
Deletes every cache version for the original image. |
void |
deleteImage(MCRFile image,
Dimension size)
|
void |
deleteImage(MCRFile image,
String filename)
Deletes one certain cache version for the original image. |
boolean |
existInCache(MCRFile image)
Checks if the original image has at least one cache version. |
boolean |
existInCache(MCRFile image,
Dimension size)
|
boolean |
existInCache(MCRFile image,
String filename)
Checks if one certain cache version of the original image exists in cache. |
void |
getImage(MCRFile image,
String filename,
OutputStream imageData)
Get the cache version of the image. |
InputStream |
getImageAsInputStream(MCRFile image,
String filename)
|
Dimension |
getImgDimension(MCRFile image)
|
int |
getImgHeight(MCRFile image)
Get the width of the original image height is stored in the cache |
int |
getImgWidth(MCRFile image)
Get the width of the original image which is stored in the cache |
static MCRImgCacheManager |
instance()
|
void |
saveImage(MCRFile image,
Dimension size,
InputStream imageData)
|
void |
saveImage(MCRFile image,
String filename,
InputStream imageData)
Save the edited image as cache for the original image. |
void |
setImgSize(MCRFile image,
int width,
int height)
Save the size of the original image in the cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String THUMB
public static final String CACHE
public static final String ORIG
public static final String CACHE_FOLDER
| Method Detail |
|---|
public static MCRImgCacheManager instance()
public void getImage(MCRFile image,
String filename,
OutputStream imageData)
CacheManager
getImage in interface CacheManagerimage - the original imagefilename - the cache version thumbnail etc.imageData - the cached image
public InputStream getImageAsInputStream(MCRFile image,
String filename)
throws IOException
getImageAsInputStream in interface CacheManagerIOException
public void saveImage(MCRFile image,
Dimension size,
InputStream imageData)
public void saveImage(MCRFile image,
String filename,
InputStream imageData)
CacheManager
saveImage in interface CacheManagerimage - the original imagefilename - the cache versionimageData - the cached image
public void deleteImage(MCRFile image,
Dimension size)
public void deleteImage(MCRFile image,
String filename)
CacheManager
deleteImage in interface CacheManagerimage - the original imagefilename - the cache version of the original imagepublic void deleteImage(MCRFile image)
CacheManager
deleteImage in interface CacheManagerimage - the original image
public boolean existInCache(MCRFile image,
String filename)
CacheManager
existInCache in interface CacheManagerimage - the original imagefilename - the cache version
public boolean existInCache(MCRFile image)
CacheManager
existInCache in interface CacheManagerpublic Dimension getImgDimension(MCRFile image)
public int getImgWidth(MCRFile image)
CacheManager
getImgWidth in interface CacheManagerimage - the original image
public int getImgHeight(MCRFile image)
CacheManager
getImgHeight in interface CacheManagerimage - the original image
public void setImgSize(MCRFile image,
int width,
int height)
CacheManager
setImgSize in interface CacheManagerimage - the original imagewidth - original image widthheight - original image height
public boolean existInCache(MCRFile image,
Dimension size)
public void deleteCache()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||