And second time thank you for your lib!
Done. Function public void fileModified(int wd, String rootPath, String name) runs onModifyTimer(name) every time event occures. It is "on fly solution", but it works. Map<String, Long> fileModifyHashMap = new LinkedHashMap<>(); ... private void onModifyTimer(String relativePath) { Long current = System.currentTimeMillis(); Long prev = fileModifyHashMap.get(relativePath); if(prev != null) { if((current-prev)>300) { System.out.println("(current-prev) = " + (current-prev)); fileModifyHashMap.put(relativePath,...
Done. Function public void fileModified(int wd, String rootPath, String name) runs onModifyTimer(name) every time event occures. Map<String, Long> fileModifyHashMap = new LinkedHashMap<>(); ... private void onModifyTimer(String relativePath) { Long current = System.currentTimeMillis(); Long prev = fileModifyHashMap.get(relativePath); if(prev != null) { if((current-prev)>300) { System.out.println("(current-prev) = " + (current-prev)); fileModifyHashMap.put(relativePath, current); onModify(relativePath);...
Done. Idea: Map<String, Long> fileModifyHashMap = new LinkedHashMap<>(); ... private void onModifyTimer(String relativePath) { Long current = System.currentTimeMillis(); Long prev = fileModifyHashMap.get(relativePath); if(prev != null) { if((current-prev)>300) { System.out.println("(current-prev) = " + (current-prev)); fileModifyHashMap.put(relativePath, current); onModify(relativePath); } } else { fileModifyHashMap.put(relativePath, current); onModify(relativePath); } } private void onModify(String...
The events are directly translated from the underlying OS events. You could aggregate them on your side. Your solution sounds reasonable. You can use a memcache like implementation that will automatically clear expired keys. Maybe something like what is described https://stackoverflow.com/questions/3802370/java-time-based-map-cache-with-expiring-keys.
Hello! Thank you for this lib! I noticed, that if file is changed, there are several modify events occures for this file. I think it is due to change size, date, lasttime access etc. Every change generate separate event? How can I merge its events to one action? For example, in standard WatchService I use Thread.sleep( 50 ) and just skip events occures at very close time. I only think use LinkedHashSet and store file paths to it, so I del duplicates. But maybe more fine method?
Hello! Thank you for this lib! I noticed, that if file is changed, there are several modify events occures for this file. I think it is due to change size, date, lasttime access etc. Every change generate separate event? How can I merge its events to one action? For example, in standard WatchService I use Thread.sleep( 50 ) and just skip events occures at very close time.
Thank you for the patch and for explaining the problem you were solving. As this is Linux specific and JNotify is cross platform, I will hold off integrating this. Others are of course free to patch this is they need this functionality and are only using Linux.
Patch to notify end of reception of a file
Hi, I have modified the source code. How can i share it to comply with EPL while using it in my soft? Thanks
Published. Maven dependency: <dependency> <groupId>net.contentobjects.jnotify</groupId>...
https://github.com/gslowikowski/jnotify-mavenization-tmp changed. There is one more...
looks fine. please rename groupId to net.contentobjects.jnotify. and I really don't...
Hi Sorry for delay I've created temporary GitHub repo https://github.com/gslowikowski/jnotify-mavenization-tmp...
Hi, Both the Java and the native parts are released under the same dual license (LGPL...
Hi I want to publish JNotify to Maven central repo and need licensing clarification....
Hi, We are planning to use jnotify to monitor 800-1000 directories in our production...
The answer here is complicated. it depends on the OS, some supports recursive watching...
Hi, when the Jnotify is started (JNotify.addWatch) I think it take some time and...
Sourceforge keeps deciding that some of your comments require moderation and I don't...
"But, sane Linux distributors, such as Debian, will instead ignore your binary jnotify.jars...
I suppose I forgot to mention one item of advice - please please please, do not ship...
You can still use libjnotify.so without a suffix, but I think it's better to try...
Would you really want to use os.arch in a build script? The architecture of the build...
I also fixed the build issue encountered with the new JDK.
See Util.java 1.2. I've attempted to normalize the architecture because different...
See Util.java 1.2. I've attempted to normalize the architecture because different...
Here is a plan: make a table with all supported OS and JRE combinations. make sure...
I think we should probe in the reverse order (try to load jnotify-amd64 before jnotify)...
I think you want to link with the 32bit binary when running on a 32bit JRE even if...
I think you want to link with the 32bit binary when running on a 32bit JRE even if...
Does os.arch return 64-bit when running 32-bit Java on a 64-bit kernel? sun.arch.data.model...
Does os.arch return 64-bit when running 32-bit Java on a 64-bit kernel? On Mar 14,...
Bumping up request.
I am traveling this week, wiki get back to you sometime next week. If i forget please...
By the way, the above code contains a superfluous ".toLowerCase()".
Using different filenames for Linux native library
Yeah, I only did that because I couldn't get it to work with the debuglevel, and...
Good change, except for the build.xml change that snuck in .
Good chance, except for the build.xml change that snuck in .
More flexible and consistent loadLibrary behaviour