org.apache.tools.ant.types.selectors.modifiedselector
Class PropertiesfileCache
java.lang.Object
org.apache.tools.ant.types.selectors.modifiedselector.PropertiesfileCache
- Cache
public class PropertiesfileCache
extends java.lang.Object
Use java.util.Properties for storing the values.
The use of this Cache-implementation requires the use of the parameter
for defining, where to store the
properties file.
The ModifiedSelector sets the
cachefile to the default value
cache.properties.
Supported
name | values | description | required |
---|
cache.cachefile | path to file | the name of the properties file | yes |
void | delete() - Deletes the cache and its underlying file.
|
Object | get(Object key) - Returns a value for a given key from the cache.
|
File | getCachefile()
|
boolean | isValid() - Checks its prerequisites.
|
Iterator | iterator() - Returns an iterator over the keys in the cache.
|
void | load() - Loads the cache, must handle not existing cache.
|
void | put(Object key, Object value) - Saves a key-value-pair in the cache.
|
void | save() - Saves modification of the cache.
|
void | setCachefile(File file)
|
String | toString() - Override Object.toString().
|
PropertiesfileCache
public PropertiesfileCache()
Bean-Constructor.
PropertiesfileCache
public PropertiesfileCache(File cachefile)
Constructor.
cachefile
- set the cachefile
delete
public void delete()
Deletes the cache and its underlying file.
- delete in interface Cache
get
public Object get(Object key)
Returns a value for a given key from the cache.
- get in interface Cache
getCachefile
public File getCachefile()
isValid
public boolean isValid()
Checks its prerequisites.
- isValid in interface Cache
- true if all is ok, otherwise false.
iterator
public Iterator iterator()
Returns an iterator over the keys in the cache.
- iterator in interface Cache
- An iterator over the keys.
load
public void load()
Loads the cache, must handle not existing cache.
- load in interface Cache
put
public void put(Object key,
Object value)
Saves a key-value-pair in the cache.
- put in interface Cache
key
- the keyvalue
- the value
save
public void save()
Saves modification of the cache.
Cache is only saved if there is one ore more entries.
Because entries can not be deleted by this API, this Cache
implementation checks the existence of entries before creating the file
for performance optimisation.
- save in interface Cache
setCachefile
public void setCachefile(File file)
toString
public String toString()
Override Object.toString().
- information about this cache
Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.