photospace.vfs.event
Class FileSystemWatcher
java.lang.Object
photospace.vfs.event.FileSystemWatcher
- All Implemented Interfaces:
- java.lang.Runnable
- public class FileSystemWatcher
- extends java.lang.Object
- implements java.lang.Runnable
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileSystemWatcher
public FileSystemWatcher()
addListener
public void addListener(FileEventListener listener)
throws java.io.IOException
- Throws:
java.io.IOException
addRoot
public void addRoot(java.io.File file)
throws java.io.IOException
- Throws:
java.io.IOException
setRoots
public void setRoots(java.util.List roots)
throws java.io.IOException
- Throws:
java.io.IOException
setListeners
public void setListeners(java.util.List listeners)
throws java.io.IOException
- Throws:
java.io.IOException
setFilter
public void setFilter(java.io.FileFilter filter)
start
public void start()
destroy
public void destroy()
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
createSnapshot
public java.util.Map createSnapshot(java.io.File[] roots)
- Creates a snapshot of the files in the provided file system roots.
The snapshot is a Map of File objects to their lastModified date
as of the time the snapshot was taken.
- Parameters:
roots
-
- Returns:
setSleep
public void setSleep(int sleep)
getSnapshot
public java.util.Map getSnapshot()