Recursive Watcher, Moved From/To
Hey Nick,
thanks again for your great project. One of my projects strongly relies on it!
I wrote two classes that I think were missing in inotify-java.
1) RecursiveWatcher
In another question I asked you about a recursive watcher, i.e. a watcher that monitors newly created folders as well and dynamically adds/removes watches for all sub-folders. Since the given classes did not support that, I wrote a class called RecursiveWatcher that does exactly that.
EXAMPLE:
int wd = watcher.
watcher.
public void filesystemEvent
System.
}
...
});
The recursive watcher first indexes all sub-directories of the "Photos" folder, and then sets watches to each of them e.g. "Photos/Album1" and "Photos/Album2". When a new album is created, or sub-folders are added to "Photos/AlbumXX", it also registers watches for these folders. Hence events are thrown for all subfolders.
2) BufferedRecursi
A second thing I really needed for my application was to not only receive Move_From and Move_To events, but directly receiving Move_From_To events from the watcher. Since inotify throws these events separately, I wrote a little class called BufferedRecursi
Are you generally interested in adding my code to the project? Unfortunately it is based on the 2.0.1 version and needs some cleanup and testing. If you are interested, I could branch the 2.0.1 version and upload it to Launchpad...
Regards,
Philipp
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Philipp C. Heckel
- Solved:
- Last query:
- Last reply: