|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectechopoint.template.AbstractDataSource
echopoint.template.FileDataSource
echopoint.template.CachedFileDataSource
public class CachedFileDataSource
A CachedFileDataSource
implements a DataSource
for a files and URLS, but caches small ones up to CACHED_SIZE_LIMIT or a
specified limit size.
Field Summary | |
---|---|
static int |
CACHED_ENTRY_LIMIT
How many entries can we have after which we will clear the cache a little. |
static int |
CACHED_SIZE_LIMIT
How big can the file be after which we wont cache it. |
Fields inherited from class echopoint.template.FileDataSource |
---|
canonicalName |
Fields inherited from class echopoint.template.AbstractDataSource |
---|
DEFAULT_ENCODING |
Constructor Summary | |
---|---|
CachedFileDataSource(java.io.File f)
Creates a cache entry for the file if its less than CACHED_SIZE_LIMIT in size. |
|
CachedFileDataSource(java.io.File f,
int cacheSize)
Creates a cache entry for the file if its less than cacheSize in size. |
|
CachedFileDataSource(java.io.File f,
int maxFileCacheSize,
java.lang.String encoding)
Creates a cached entry for the File f if its less than maxFileCacheSize in size. |
|
CachedFileDataSource(java.net.URL url)
Creates a cached entry for the URL url. |
|
CachedFileDataSource(java.net.URL url,
java.lang.String encoding)
Creates a cached entry for the URL url. |
Method Summary | |
---|---|
java.io.Reader |
getInputReader()
Gets an Reader of the File. |
long |
lastModified()
Returns the time the content of this File was last modified. |
Methods inherited from class echopoint.template.FileDataSource |
---|
getCanonicalName |
Methods inherited from class echopoint.template.AbstractDataSource |
---|
getCharacterEncoding, setCharacterEncoding |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CACHED_SIZE_LIMIT
public static final int CACHED_ENTRY_LIMIT
Constructor Detail |
---|
public CachedFileDataSource(java.io.File f) throws java.io.IOException, java.io.UnsupportedEncodingException
Uses the default character encoding of AbstractDataSource.DEFAULT_ENCODING
java.io.IOException
java.io.UnsupportedEncodingException
public CachedFileDataSource(java.io.File f, int cacheSize) throws java.io.IOException, java.io.UnsupportedEncodingException
Uses the default character encoding of AbstractDataSource.DEFAULT_ENCODING
java.io.IOException
java.io.UnsupportedEncodingException
public CachedFileDataSource(java.io.File f, int maxFileCacheSize, java.lang.String encoding) throws java.io.IOException, java.io.UnsupportedEncodingException
Uses the character encoding supplied
java.io.IOException
java.io.UnsupportedEncodingException
public CachedFileDataSource(java.net.URL url) throws java.io.IOException, java.io.UnsupportedEncodingException
Uses the default character encoding of "iso-8859-1"
java.io.IOException
java.io.UnsupportedEncodingException
public CachedFileDataSource(java.net.URL url, java.lang.String encoding) throws java.io.IOException, java.io.UnsupportedEncodingException
Uses the character encoding provided.
java.io.IOException
java.io.UnsupportedEncodingException
Method Detail |
---|
public java.io.Reader getInputReader() throws java.io.IOException
getInputReader
in interface DataSource
getInputReader
in class FileDataSource
java.io.IOException
public long lastModified()
The return value is used to decide whether to reparse a Source or not. Reparsing is done if the value returned here differs from the value returned at the last processing time.
lastModified
in interface DataSource
lastModified
in class FileDataSource
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |