com.nostra13.universalimageloader.cache.disc.impl
Class LimitedAgeDiscCache
java.lang.Object
com.nostra13.universalimageloader.cache.disc.BaseDiscCache
com.nostra13.universalimageloader.cache.disc.impl.LimitedAgeDiscCache
- All Implemented Interfaces:
- DiscCacheAware
public class LimitedAgeDiscCache
- extends BaseDiscCache
Cache which deletes files which were loaded more than defined time. Cache size is unlimited.
- Since:
- 1.3.1
- Author:
- Sergey Tarasevich (nostra13[at]gmail[dot]com)
- See Also:
BaseDiscCache
Method Summary |
java.io.File |
get(java.lang.String key)
Returns file object appropriate incoming key. |
void |
put(java.lang.String key,
java.io.File file)
This method must not to save file on file system in fact. |
Methods inherited from class com.nostra13.universalimageloader.cache.disc.BaseDiscCache |
clear |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LimitedAgeDiscCache
public LimitedAgeDiscCache(java.io.File cacheDir,
long maxAge)
- Parameters:
cacheDir
- Directory for file cachingmaxAge
- Max file age (in seconds). If file age will exceed this value then it'll be removed on next
treatment (and therefore be reloaded).
LimitedAgeDiscCache
public LimitedAgeDiscCache(java.io.File cacheDir,
FileNameGenerator fileNameGenerator,
long maxAge)
- Parameters:
cacheDir
- Directory for file cachingfileNameGenerator
- Name generator for cached filesmaxAge
- Max file age (in seconds). If file age will exceed this value then it'll be removed on next
treatment (and therefore be reloaded).
put
public void put(java.lang.String key,
java.io.File file)
- Description copied from interface:
DiscCacheAware
- This method must not to save file on file system in fact. It is called after image was cached in cache directory
and it was decoded to bitmap in memory. Such order is required to prevent possible deletion of file after it was
cached on disc and before it was tried to decode to bitmap.
get
public java.io.File get(java.lang.String key)
- Description copied from interface:
DiscCacheAware
- Returns file object appropriate incoming key.
NOTE: Must not to return a null. Method must return specific file object for
incoming key whether file exists or not.
- Specified by:
get
in interface DiscCacheAware
- Overrides:
get
in class BaseDiscCache
Copyright © 2011-2013. All Rights Reserved.