public final class PropertyCacheFile extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONFIG_HASH_KEY
The property key to use for storing the hashcode of the
configuration.
|
static java.lang.String |
EXTERNAL_RESOURCE_KEY_PREFIX
The property prefix to use for storing the hashcode of an
external resource.
|
| Constructor and Description |
|---|
PropertyCacheFile(Configuration config,
java.lang.String fileName)
Creates a new
PropertyCacheFile instance. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
get(java.lang.String name)
Retrieves the hash of a specific file.
|
boolean |
isInCache(java.lang.String uncheckedFileName,
long timestamp)
Checks that file is in cache.
|
void |
load()
Load cached values from file.
|
void |
persist()
Cleans up the object and updates the cache file.
|
void |
put(java.lang.String checkedFileName,
long timestamp)
Records that a file checked ok.
|
void |
putExternalResources(java.util.Set<java.lang.String> locations)
Puts external resources in cache.
|
void |
remove(java.lang.String checkedFileName)
Removed a specific file from the cache.
|
void |
reset()
Resets the cache to be empty except for the configuration hash.
|
public static final java.lang.String CONFIG_HASH_KEY
public static final java.lang.String EXTERNAL_RESOURCE_KEY_PREFIX
public PropertyCacheFile(Configuration config, java.lang.String fileName)
PropertyCacheFile instance.config - the current configuration, not nullfileName - the cache filejava.lang.IllegalArgumentException - when either arguments are nullpublic void load() throws java.io.IOException
java.io.IOException - when there is a problems with file readpublic void persist() throws java.io.IOException
java.io.IOException - when there is a problems with file savepublic void reset()
public boolean isInCache(java.lang.String uncheckedFileName, long timestamp)
uncheckedFileName - the file to checktimestamp - the timestamp of the file to checkpublic void put(java.lang.String checkedFileName, long timestamp)
checkedFileName - name of the file that checked oktimestamp - the timestamp of the filepublic java.lang.String get(java.lang.String name)
name - The name of the file to retrieve.null.public void remove(java.lang.String checkedFileName)
checkedFileName - The name of the file to remove.public void putExternalResources(java.util.Set<java.lang.String> locations)
locations - locations of external resources.Copyright © 2001-2020. All Rights Reserved.