com.tagtraum.perf.io
Class FileCache

java.lang.Object
  |
  +--com.tagtraum.perf.io.FileCache

public class FileCache
extends java.lang.Object

File cache that uses byte arrays for representing files internally.

Note: This implementation is not synchronized.

Version:
$Id: $
Author:
Hendrik Schreiber

Nested Class Summary
static interface FileCache.Entry
          FileCache-Entry.
 
Constructor Summary
FileCache(Cache cache)
          Initializes this FileCache with a given Cache-Object.
 
Method Summary
 FileCache.Entry get(java.io.File file)
          Gets a FileCache.Entry for a File object.
 long getMaxFilesize()
          Maximum size of a file to qualify for caching.
 long getMinFilesize()
          Minimum size of a file to qualify for caching.
 int getTimeToLive()
          Returns the default length of the validity interval in ms without checking, whether the cached content of an entry is still valid.
 void setMaxFilesize(long maxFilesize)
          Maximum size of a file to qualify for caching.
 void setMinFilesize(long minFilesize)
          Minimum size of a file to qualify for caching.
 void setTimeToLive(int timeToLive)
          Sets the default length of the validity interval in ms without checking, whether the cached content of an entry is still valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileCache

public FileCache(Cache cache)
Initializes this FileCache with a given Cache-Object.

Method Detail

get

public FileCache.Entry get(java.io.File file)
                    throws java.io.IOException
Gets a FileCache.Entry for a File object.

java.io.IOException

getMinFilesize

public long getMinFilesize()
Minimum size of a file to qualify for caching.


setMinFilesize

public void setMinFilesize(long minFilesize)
Minimum size of a file to qualify for caching.


getMaxFilesize

public long getMaxFilesize()
Maximum size of a file to qualify for caching.


setMaxFilesize

public void setMaxFilesize(long maxFilesize)
Maximum size of a file to qualify for caching.


getTimeToLive

public int getTimeToLive()
Returns the default length of the validity interval in ms without checking, whether the cached content of an entry is still valid. Negative values equate to infinity.


setTimeToLive

public void setTimeToLive(int timeToLive)
Sets the default length of the validity interval in ms without checking, whether the cached content of an entry is still valid. Negative values equate to infinity.



Copyright © 2002 Hendrik Schreiber
http://www.tagtraum.com/performance/
This software can be distributed under LGPL