-
Notifications
You must be signed in to change notification settings - Fork 1.1k
GH-8659: Fix the WatchServiceDirectoryScanner to detect new file afte… #8662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…t new file after renaming the sub-folder of the watched folder (Java 7 WatchService)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good, however I would like to suggest some change to the file.adoc
.
Go to the [[watch-service-directory-scanner]]
section and explain there in the end that we need to track also WatchEventType.MODIFY
and WatchEventType.DELETE
event types if sub-directories can be renamed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test has failed, probably due to your change:
WatchServiceDirectoryScannerTests > testWatchServiceDirectoryScanner() FAILED
java.lang.AssertionError at WatchServiceDirectoryScannerTests.java:220
Please, revise.
The fix seems to solve the problem on Windows - the files are detected properly in the sub-folder (of the watched folder) after renaming it. I will update documentation tomorrow... |
I've tried to replicate the issue in Java in order to write the Integration test which covers that issue.
with no success - the file in sub-directory is detected properly. The issue can be replicated in Windows with the File Explorer or with the Command Line by using the following commands:
Theoretically, the Runtime.getRuntime().exec(...) could be used for the integration test but it would work obviously only for Windows (or for all Os'es when mapping md -> mkdir, copy -> cp etc....). I've updated the documentation as You requested. |
... and cherry-picked to thank you for contribution; looking forward for more! |
Fix the WatchServiceDirectoryScanner to detect new file after renaming the sub-folder of the watched folder (Java 7 WatchService)