com.teamdev.filewatch.mac
Class FSEventWatcher
java.lang.Object
com.teamdev.filewatch.FileWatcher
com.teamdev.filewatch.mac.FSEventWatcher
public class FSEventWatcher
- extends FileWatcher
Constructor Summary |
FSEventWatcher(java.io.File folder)
Creates a new watcher for the specified folder. |
Method Summary |
void |
eventReceived(java.lang.String fileName,
long flags,
long eventId)
|
protected java.util.List<FileEvent> |
readEvents()
Reads next portion of file system events. |
protected void |
release()
Releases all native resources which are associated with a watcher instance. |
void |
setStartingId(long id)
|
protected void |
startWatching()
Notifies watcher that the watching is going to be started. |
protected void |
stopWatching()
Notifies watcher that the watching is going to be stopped. |
Methods inherited from class com.teamdev.filewatch.FileWatcher |
accept, addFileEventsListener, addListener, addListener, addWatcherListener, create, getFilter, getFolder, getOptions, isRunning, removeFileEventsListener, removeListener, removeListener, removeWatcherListener, resetOptions, setFilter, setOptions, setOptions, setRunning, setRunning, start, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FSEventWatcher
public FSEventWatcher(java.io.File folder)
- Creates a new watcher for the specified folder.
- Parameters:
folder
- a root folder to monitor file system events. Must not be null
- Throws:
java.lang.IllegalArgumentException
- if the passed instance is not a directory or does not exist
setStartingId
public void setStartingId(long id)
startWatching
protected void startWatching()
- Description copied from class:
FileWatcher
- Notifies watcher that the watching is going to be started.
- Specified by:
startWatching
in class FileWatcher
readEvents
protected java.util.List<FileEvent> readEvents()
- Description copied from class:
FileWatcher
- Reads next portion of file system events. This method should have event-driven implementation: a file system generates
some events and only then method should return them.
- Specified by:
readEvents
in class FileWatcher
- Returns:
- portion of file system events
stopWatching
protected void stopWatching()
- Description copied from class:
FileWatcher
- Notifies watcher that the watching is going to be stopped.
- Specified by:
stopWatching
in class FileWatcher
release
protected void release()
- Description copied from class:
FileWatcher
- Releases all native resources which are associated with a watcher instance.
- Specified by:
release
in class FileWatcher
eventReceived
public void eventReceived(java.lang.String fileName,
long flags,
long eventId)