Note that there are some explanatory texts on larger screens.

plurals
  1. POJDK 7 Watchkey pollEvents not capturing ENTRY_CREATE or ENTRY_MODIFY when large number of files are being copied
    text
    copied!<p>I am trying to watch all modifications that are being done to a specific folder. When I copy a folder including 2~5 subfolders with each having 2~3 files. Everything works great.</p> <p>The problem arises when I copy complicated folder structures. For example, when I copy any sample web application folder (for testing purposes only) where the WEB-INF folder has numerous source files and subfolders in the classes folder, and large number of jars in the lib folder and so on and so forth.</p> <p>Lots of file events for "ENTRY_CREATE" and "ENTRY_MODIFY" for lots of files are being missed.</p> <p>Is the NIO2 Watcher API unreliable ?</p> <p>Im using the following snippet as documented in the Oracle web site.</p> <pre><code>WatchKey watchKey = folderPathToMonitor.register(watchService,StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY); </code></pre> <p>And this is how I'm capturing the events : The code is exactly the one as in here - <a href="http://docs.oracle.com/javase/tutorial/displayCode.html?code=http://docs.oracle.com/javase/tutorial/essential/io/examples/WatchDir.java" rel="nofollow">http://docs.oracle.com/javase/tutorial/displayCode.html?code=http://docs.oracle.com/javase/tutorial/essential/io/examples/WatchDir.java</a></p> <p>I copy, say about 500 files in 30 folders and Ideally ENTRY_CREATE and ENTRY_MODIFY has to be notified for as many files and folders. But the maximum events(ENTRY_CREATE and ENTRY_MODIFY clubbed together) captured is not going past 280 whereas a minimum of 530 ENTRY_CREATE events alone should be registered for the 530 files and folders that were copied.</p> <p>Any thing I'm missing out or have to add to the watching code from oracle.com ? Any suggestions regarding this are highly appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload