rabbit.cache.utils
Class CacheUtils

java.lang.Object
  extended by rabbit.cache.utils.CacheUtils

public class CacheUtils
extends Object

Helper methods for file based caches.

Author:
Robert Olofsson

Field Summary
static int FILES_PER_DIR
          The maximum number of files per directory
static String TEMPDIR
          The name of the temporary cache files directory
 
Constructor Summary
CacheUtils()
           
 
Method Summary
static File getEntryName(File baseDir, long id, boolean real, String extension)
          Get the file name for a cache entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILES_PER_DIR

public static final int FILES_PER_DIR
The maximum number of files per directory

See Also:
Constant Field Values

TEMPDIR

public static final String TEMPDIR
The name of the temporary cache files directory

See Also:
Constant Field Values
Constructor Detail

CacheUtils

public CacheUtils()
Method Detail

getEntryName

public static File getEntryName(File baseDir,
                                long id,
                                boolean real,
                                String extension)
Get the file name for a cache entry.

Parameters:
baseDir - the base directory for the cache
id - the id of the cache entry
real - false if this is a temporary cache file, true if it is a realized entry.
extension - the file extension to use
Returns:
the file to use for the cached object