Top Inners Fields Constructors Methods
com.mchange.v3.filecache

public final Class FileCache

extends Object
Class Inheritance
Imports
java.io.*, java.net.*, java.util.*, com.mchange.v2.io.*, com.mchange.v2.log.*, com.mchange.v1.io.InputStreamUtils, .OutputStreamUtils

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final File
pack-priv final List<URLFetcher>
pack-priv static final MLogger
pack-priv static final FileFilter
pack-priv final boolean

Constructor Summary

AccessConstructor and Description
public
FileCache(File cacheDir, int buffer_size, boolean read_only)

public
FileCache(File cacheDir, int buffer_size, boolean read_only, URLFetcher... fetchers)

public
FileCache(File cacheDir, int buffer_size, boolean read_only, List<URLFetcher> fetchers)

Method Summary

Modifier and TypeMethod and Description
public int
public int
public void
ensureCached(FileCacheKey key, boolean force_reacquire)

public InputStream
fetch(FileCacheKey key, boolean force_reacquire)

private InputStream
private File
public File
public boolean
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

buffer_sizeback to summary
pack-priv final int buffer_size
cacheDirback to summary
pack-priv final File cacheDir
fetchersback to summary
pack-priv final List<URLFetcher> fetchers
loggerback to summary
pack-priv static final MLogger logger
NOT_DIR_FFback to summary
pack-priv static final FileFilter NOT_DIR_FF
read_onlyback to summary
pack-priv final boolean read_only

Constructor Detail

FileCacheback to summary
public FileCache(File cacheDir, int buffer_size, boolean read_only) throws IOException
FileCacheback to summary
public FileCache(File cacheDir, int buffer_size, boolean read_only, URLFetcher... fetchers) throws IOException
FileCacheback to summary
public FileCache(File cacheDir, int buffer_size, boolean read_only, List<URLFetcher> fetchers) throws IOException

Method Detail

countCachedback to summary
public int countCached() throws IOException
countCachedback to summary
public int countCached(FileFilter filter) throws IOException
ensureCachedback to summary
public void ensureCached(FileCacheKey key, boolean force_reacquire) throws IOException
fetchback to summary
public InputStream fetch(FileCacheKey key, boolean force_reacquire) throws IOException
fetchURLback to summary
private InputStream fetchURL(URL u) throws IOException
fileback to summary
private File file(FileCacheKey key)
fileForKeyback to summary
public File fileForKey(FileCacheKey key)
isCachedback to summary
public boolean isCached(FileCacheKey key) throws IOException
loggedIOExceptionback to summary
private void loggedIOException(MLevel lvl, String msg) throws IOException
com.mchange.v3.filecache back to summary

pack-priv Class FileCache.NotDirAndFileFilter

extends Object
implements FileFilter
Class Inheritance
All Implemented Interfaces
java.io.FileFilter

Field Summary

Modifier and TypeField and Description
pack-priv FileFilter

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
accept(File
The abstract pathname to be tested
f
)

Implements java.io.FileFilter.accept.

Tests whether or not the specified abstract pathname should be included in a pathname list.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ffback to summary
pack-priv FileFilter ff

Constructor Detail

NotDirAndFileFilterback to summary
pack-priv NotDirAndFileFilter(FileFilter ff)

Method Detail

acceptback to summary
public boolean accept(File f)

Implements java.io.FileFilter.accept.

Doc from java.io.FileFilter.accept.

Tests whether or not the specified abstract pathname should be included in a pathname list.

Parameters
f:File

The abstract pathname to be tested

Returns:boolean

true if and only if pathname should be included