public class PropertiesCache
extends java.lang.Object
Constructor and Description |
---|
PropertiesCache() |
Modifier and Type | Method and Description |
---|---|
java.util.Properties |
getProperties(java.io.File file)
Get the java Properties stored in the file, loading from disk only if the file has been modified
since the last read, or the cached data has been invalidated.
|
boolean |
needsReload(java.io.File file)
Returns true if the file does not exist, or has been modified since the last time it was loaded.
|
void |
touch(java.io.File file)
Clear cached data for the file, causing a reload for the next call of
getProperties(java.io.File) |
public boolean needsReload(java.io.File file) throws java.io.IOException
file
- File to checkjava.io.IOException
- on io errorpublic java.util.Properties getProperties(java.io.File file) throws java.io.IOException
file
- java properties filejava.io.IOException
- due to file read or find errorpublic void touch(java.io.File file)
getProperties(java.io.File)
file
- file