public class FileCacheManager extends java.lang.Object implements ICacheManager
ICacheManager
that stores the
CacheObject
in the filesystem on the device.Constructor and Description |
---|
FileCacheManager() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all
CacheObject s from the cache. |
boolean |
delete(CacheObject cacheObject) |
boolean |
exists(CacheObject cacheObject) |
byte[] |
fromCache(CacheObject cacheObject) |
void |
toCache(CacheObject cacheObject)
Stores the given
CacheObject in the cache. |
public void toCache(CacheObject cacheObject) throws java.io.IOException
ICacheManager
CacheObject
in the cache. Overwrites the cached
value if the same object exists already.toCache
in interface ICacheManager
java.io.IOException
public byte[] fromCache(CacheObject cacheObject) throws java.io.IOException
fromCache
in interface ICacheManager
CacheObject
; might be
null
java.io.IOException
public boolean exists(CacheObject cacheObject)
exists
in interface ICacheManager
true
if the given CacheObject
exists in the
cache; false
otherwise.public boolean delete(CacheObject cacheObject)
delete
in interface ICacheManager
true
if the given CacheObject
was successfully
deleted.public void clear()
ICacheManager
CacheObject
s from the cache.clear
in interface ICacheManager