com.mchange.v3.filecache
Class FileCache

java.lang.Object
  extended by com.mchange.v3.filecache.FileCache

public final class FileCache
extends java.lang.Object


Constructor Summary
FileCache(java.io.File cacheDir, int buffer_size, boolean read_only)
           
FileCache(java.io.File cacheDir, int buffer_size, boolean read_only, java.util.List<URLFetcher> fetchers)
           
FileCache(java.io.File cacheDir, int buffer_size, boolean read_only, URLFetcher... fetchers)
           
 
Method Summary
 int countCached()
           
 int countCached(java.io.FileFilter filter)
           
 void ensureCached(FileCacheKey key, boolean force_reacquire)
           
 java.io.InputStream fetch(FileCacheKey key, boolean force_reacquire)
           
 java.io.File fileForKey(FileCacheKey key)
           
 boolean isCached(FileCacheKey key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileCache

public FileCache(java.io.File cacheDir,
                 int buffer_size,
                 boolean read_only)
          throws java.io.IOException
Throws:
java.io.IOException

FileCache

public FileCache(java.io.File cacheDir,
                 int buffer_size,
                 boolean read_only,
                 URLFetcher... fetchers)
          throws java.io.IOException
Throws:
java.io.IOException

FileCache

public FileCache(java.io.File cacheDir,
                 int buffer_size,
                 boolean read_only,
                 java.util.List<URLFetcher> fetchers)
          throws java.io.IOException
Throws:
java.io.IOException
Method Detail

ensureCached

public void ensureCached(FileCacheKey key,
                         boolean force_reacquire)
                  throws java.io.IOException
Throws:
java.io.IOException

fetch

public java.io.InputStream fetch(FileCacheKey key,
                                 boolean force_reacquire)
                          throws java.io.IOException
Throws:
java.io.IOException

isCached

public boolean isCached(FileCacheKey key)
                 throws java.io.IOException
Throws:
java.io.IOException

countCached

public int countCached()
                throws java.io.IOException
Throws:
java.io.IOException

countCached

public int countCached(java.io.FileFilter filter)
                throws java.io.IOException
Throws:
java.io.IOException

fileForKey

public java.io.File fileForKey(FileCacheKey key)