com.blogspot.applications4android.comicreader.core
Class Cache

java.lang.Object
  extended by com.blogspot.applications4android.comicreader.core.Cache

public class Cache
extends java.lang.Object

Cache folder for a comic


Field Summary
static java.lang.String CACHE
          cache folder name
static int MAX_FILES
          maximum number of files to be kept in the cache before recycling
static int MIN_FILES
          minimum number of files to be kept while cleaning the cache
 
Constructor Summary
Cache(java.io.File root)
          Constructor (to be generally used in test-cases)
Cache(java.lang.String name)
          Constructor
 
Method Summary
 java.lang.String cachePath()
          Path to the cache folder
 void clearCache()
          Delete all the files in the cache
 void makeSpace()
          Clear only the oldest files to make space for newer ones
 int numFiles()
          Number of files in the cache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE

public static final java.lang.String CACHE
cache folder name

See Also:
Constant Field Values

MAX_FILES

public static final int MAX_FILES
maximum number of files to be kept in the cache before recycling

See Also:
Constant Field Values

MIN_FILES

public static final int MIN_FILES
minimum number of files to be kept while cleaning the cache

See Also:
Constant Field Values
Constructor Detail

Cache

public Cache(java.lang.String name)
Constructor

Parameters:
name - name of the comic this cache is for

Cache

public Cache(java.io.File root)
Constructor (to be generally used in test-cases)

Parameters:
root - root folder
Method Detail

cachePath

public java.lang.String cachePath()
Path to the cache folder

Returns:
path

clearCache

public void clearCache()
Delete all the files in the cache


makeSpace

public void makeSpace()
Clear only the oldest files to make space for newer ones


numFiles

public int numFiles()
Number of files in the cache

Returns:
number