com.nostra13.universalimageloader.cache.disc.impl
Class TotalSizeLimitedDiscCache

java.lang.Object
  extended by com.nostra13.universalimageloader.cache.disc.BaseDiscCache
      extended by com.nostra13.universalimageloader.cache.disc.LimitedDiscCache
          extended by com.nostra13.universalimageloader.cache.disc.impl.TotalSizeLimitedDiscCache
All Implemented Interfaces:
DiscCacheAware

public class TotalSizeLimitedDiscCache
extends LimitedDiscCache

Disc cache limited by total cache size. If cache size exceeds specified limit then file with the most oldest last usage date will be deleted.

Since:
1.0.0
Author:
Sergey Tarasevich (nostra13[at]gmail[dot]com)
See Also:
LimitedDiscCache

Field Summary
 
Fields inherited from class com.nostra13.universalimageloader.cache.disc.BaseDiscCache
cacheDir
 
Constructor Summary
TotalSizeLimitedDiscCache(java.io.File cacheDir, FileNameGenerator fileNameGenerator, int maxCacheSize)
           
TotalSizeLimitedDiscCache(java.io.File cacheDir, int maxCacheSize)
           
 
Method Summary
protected  int getSize(java.io.File file)
           
 
Methods inherited from class com.nostra13.universalimageloader.cache.disc.LimitedDiscCache
clear, get, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TotalSizeLimitedDiscCache

public TotalSizeLimitedDiscCache(java.io.File cacheDir,
                                 int maxCacheSize)
Parameters:
cacheDir - Directory for file caching. Important: Specify separate folder for cached files. It's needed for right cache limit work.
maxCacheSize - Maximum cache directory size (in bytes). If cache size exceeds this limit then file with the most oldest last usage date will be deleted.

TotalSizeLimitedDiscCache

public TotalSizeLimitedDiscCache(java.io.File cacheDir,
                                 FileNameGenerator fileNameGenerator,
                                 int maxCacheSize)
Parameters:
cacheDir - Directory for file caching. Important: Specify separate folder for cached files. It's needed for right cache limit work.
fileNameGenerator - Name generator for cached files
maxCacheSize - Maximum cache directory size (in bytes). If cache size exceeds this limit then file with the most oldest last usage date will be deleted.
Method Detail

getSize

protected int getSize(java.io.File file)
Specified by:
getSize in class LimitedDiscCache


Copyright © 2011-2013. All Rights Reserved.