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

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.FileCountLimitedDiscCache
All Implemented Interfaces:
DiscCacheAware

public class FileCountLimitedDiscCache
extends LimitedDiscCache

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

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

Constructor Summary
FileCountLimitedDiscCache(java.io.File cacheDir, FileNameGenerator fileNameGenerator, int maxFileCount)
           
FileCountLimitedDiscCache(java.io.File cacheDir, int maxFileCount)
           
 
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 com.nostra13.universalimageloader.cache.disc.BaseDiscCache
getCacheDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileCountLimitedDiscCache

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

FileCountLimitedDiscCache

public FileCountLimitedDiscCache(java.io.File cacheDir,
                                 FileNameGenerator fileNameGenerator,
                                 int maxFileCount)
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
maxFileCount - Maximum file count for cache. If file count in cache directory 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.