public class StreamCacheFactory
extends java.lang.Object
Constructor and Description |
---|
StreamCacheFactory(boolean cacheToFile)
Creates a new StreamCacheFactory.
|
Modifier and Type | Method and Description |
---|---|
StreamCache |
createStreamCache()
Get the correct implementation (based on cacheToFile) of
StreamCache.
|
StreamCache |
createStreamCache(int hintSize)
Get the correct implementation (based on cacheToFile) of
StreamCache.
|
boolean |
getCacheToFile()
Get the value of the global cacheToFile flag.
|
static StreamCacheFactory |
getInstance()
Returns an instance of a StreamCacheFactory depending on the default
setting for cacheToFile.
|
static StreamCacheFactory |
getInstance(boolean cacheToFile)
Returns an instance of a StreamCacheFactory with the requested features.
|
static void |
setDefaultCacheToFile(boolean cacheToFile)
Sets the global default for cacheToFile
|
public StreamCacheFactory(boolean cacheToFile)
cacheToFile
- True if file shall be cached using a temporary filepublic static StreamCacheFactory getInstance(boolean cacheToFile)
cacheToFile
- True if file shall be cached using a temporary filepublic static StreamCacheFactory getInstance()
public static void setDefaultCacheToFile(boolean cacheToFile)
cacheToFile
- True if stream caches should be held in files.public StreamCache createStreamCache() throws java.io.IOException
java.io.IOException
- if there is an IO errorpublic StreamCache createStreamCache(int hintSize) throws java.io.IOException
hintSize
- a hint about the approximate expected size of the bufferjava.io.IOException
- if there is an IO errorpublic boolean getCacheToFile()
Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.