Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:12:09+00:00 2026-06-14T18:12:09+00:00

I am trying to watch all modifications that are being done to a specific

  • 0

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.

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.

Lots of file events for “ENTRY_CREATE” and “ENTRY_MODIFY” for lots of files are being missed.

Is the NIO2 Watcher API unreliable ?

Im using the following snippet as documented in the Oracle web site.

WatchKey watchKey = folderPathToMonitor.register(watchService,StandardWatchEventKinds.ENTRY_CREATE,
                StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY);

And this is how I’m capturing the events :
The code is exactly the one as in here – http://docs.oracle.com/javase/tutorial/displayCode.html?code=http://docs.oracle.com/javase/tutorial/essential/io/examples/WatchDir.java

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.

Any thing I’m missing out or have to add to the watching code from oracle.com ?
Any suggestions regarding this are highly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:12:10+00:00Added an answer on June 14, 2026 at 6:12 pm

    Ok. Used jnotify and solved this. Pretty straightforward. Had to cook up some code for ignoring multiple events for same operation. But got it working.
    Get jnotify at – http://jnotify.sourceforge.net/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use inotifywait to watch all .js files under my ~/js
I see that the Quick Watch window has access to all properties, irrespective of
I'm trying to write a bash script that will download all of the youtube
I'm trying to copy a listbox to another one So I clear all items
I'm trying to watch a process and wait for a certain pattern, say: open
I have been trying to add to the Watch window a Java Date object
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
Trying to copy the msdn refernce here doesn't work and gives an error I
I'm trying to deal with a piece of specialized hardware, that presents it's interface
hi all I'm trying to extract the META description from a webpage using libxml

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.