|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.vamsas.client.simpleclient.FileWatcher
Watches a particular file for its creation, deletion, or modification. The watcher is thread safe and different instances watching the state of a particular file carry their own state record for the file.
Constructor Summary | |
FileWatcher(java.io.File subject)
Make a watcher for a particular file. |
Method Summary | |
boolean |
diffState(long[] a,
long[] b)
safely compare an externally recorded state with the current state for significant modifications. |
Lock |
getChangedState()
passes lock back to caller if hasChanged returned true. |
long[] |
getCurrentState()
safely? getting current state of the watched file |
java.io.File |
getSubject()
|
boolean |
hasChanged()
Test for change in file state. |
void |
setState()
updates internal record of file state when caller has intentionally modified subject. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileWatcher(java.io.File subject)
subject
- Method Detail |
public void setState()
public boolean hasChanged()
public Lock getChangedState()
public long[] getCurrentState()
public boolean diffState(long[] a, long[] b)
a
- b
-
public java.io.File getSubject()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |