Class PropertiesfileCache
- java.lang.Object
- 
- org.apache.tools.ant.types.selectors.modifiedselector.PropertiesfileCache
 
- 
- All Implemented Interfaces:
- Cache
 
 public class PropertiesfileCache extends java.lang.Object implements Cache Use java.util.Properties for storing the values. The use of this Cache-implementation requires the use of the parameter <param name="cache.cachefile" .../> for defining, where to store the properties file. The ModifiedSelector sets the cachefile to the default value cache.properties. Supported <param>s are:Cache parameters name values description required cache.cachefile path to file the name of the properties file yes - Since:
- Ant 1.6
- Version:
- 2003-09-13
 
- 
- 
Constructor SummaryConstructors Constructor Description PropertiesfileCache()Bean-Constructor.PropertiesfileCache(java.io.File cachefile)Constructor.
 - 
Method SummaryModifier and Type Method Description voiddelete()Deletes the cache and its underlying file.java.lang.Objectget(java.lang.Object key)Returns a value for a given key from the cache.java.io.FilegetCachefile()Getter.booleanisValid()This cache is valid if the cachefile is set.java.util.Iterator<java.lang.String>iterator()Returns an iterator over the keys in the cache.voidload()Load the cache from underlying properties file.voidput(java.lang.Object key, java.lang.Object value)Saves a key-value-pair in the cache.voidsave()Saves modification of the cache.voidsetCachefile(java.io.File file)Setter.java.lang.StringtoString()Override Object.toString().
 
- 
- 
- 
Method Detail- 
setCachefilepublic void setCachefile(java.io.File file) Setter.- Parameters:
- file- new value
 
 - 
getCachefilepublic java.io.File getCachefile() Getter.- Returns:
- the cachefile
 
 - 
isValidpublic boolean isValid() This cache is valid if the cachefile is set.
 - 
loadpublic void load() Load the cache from underlying properties file.
 - 
savepublic 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.
 - 
deletepublic void delete() Deletes the cache and its underlying file.
 - 
getpublic java.lang.Object get(java.lang.Object key) Returns a value for a given key from the cache.
 - 
putpublic void put(java.lang.Object key, java.lang.Object value)Saves a key-value-pair in the cache.
 - 
iteratorpublic java.util.Iterator<java.lang.String> iterator() Returns an iterator over the keys in the cache.
 - 
toStringpublic java.lang.String toString() Override Object.toString().- Overrides:
- toStringin class- java.lang.Object
- Returns:
- information about this cache
 
 
- 
 
-