org.apache.tools.ant.types.selectors.modifiedselector
Class PropertiesfileCache
public
class
PropertiesfileCache
extends Object
implements Cache
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
s are:
| name | values | description | required |
| cache.cachefile |
path to file |
the name of the properties file |
yes |
Since: Ant 1.6
Version: 2003-09-13
| Method Summary |
| 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() |
| Iterator | iterator()
Returns an iterator over the keys in the cache. |
| void | load() |
| 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(). |
public PropertiesfileCache()
Bean-Constructor.
public PropertiesfileCache(File cachefile)
Constructor.
Parameters: cachefile set the cachefile
public void delete()
Deletes the cache and its underlying file.
public Object get(Object key)
Returns a value for a given key from the cache.
Parameters: key the key
Returns: the stored value
public File getCachefile()
public boolean isValid()
public Iterator iterator()
Returns an iterator over the keys in the cache.
Returns: An iterator over the keys.
public void load()
public void put(Object key, Object value)
Saves a key-value-pair in the cache.
Parameters: key the key value the value
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.
public void setCachefile(File file)
public String toString()
Override Object.toString().
Returns: information about this cache
Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.