-
Notifications
You must be signed in to change notification settings - Fork 779
2341-watch-service-relative-path #2432
2341-watch-service-relative-path #2432
Conversation
6daa817
to
c0679ec
Compare
I have no idea why the ip-validation fails. The author and the committer of the last commit seems to be both set to Svilen Valkanov (not svilenvul). |
@svilenvul Never mind failing IP checks - we can always manually check the CLAs, this isn't a blocker. |
You are right, it seems to be correct and well formatted.
Also the manual validation succeeds, so I see no blocker here as well. |
…hived#1597) * The watch service is now providing the relative path to the file when a watch event is processed. The directory modifications can be now optionally watched. Added more tests to ensure that the watch service is adequately working (some tests are platform dependent). The list of handled test events is now synchronized as several threads are accessing it. FolderObserver and ConfigDispatcher are adapted to the changes in the AbstractWatchService. Signed-off-by: Dimitar Ivanov <dstivanov@gmail.com>
…rchived#1754. The implementation of FolderObserver#processWatchEvent() does not get the file name correctly. This led to duplicated directory names (see the logs in eclipse-archived#1597). AbstractWatchServiceTest is modified to run on different OS. Signed-off-by: Svilen Valkanov <svilen.valkanov@musala.com>
c0679ec
to
c22c806
Compare
The first commit from @dstivanov has been already reviewed once in #1597. In the second commit I have only adapted the tests to run on different OS and fixed the small bug in FolderObserver that was the reason to revert the first commit. Now all the tests ( for AbstractWatchService, FolderObserver and ConfigDispatcher) are green. Could you please take a brief look at the PR ? |
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.
lgtm
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 in all it looks goot. Just some minor comments about style.
protected void registerDirectory(Path subDir) throws IOException { | ||
subDir.register(watchService, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY); | ||
protected WatchKey registerDirectory(Path subDir) throws IOException { | ||
WatchKey registrationKey = subDir.register(watchService, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY); |
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.
* in the watch service. | ||
*/ | ||
public AbstractWatchQueueReader(WatchService watchService, Path watchedDir, Map<WatchKey, Path> registeredKeys) { | ||
this.watchService = 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.
I would prefer to call:
this(watchService, watchedDir, registeredKeys, true);
if (subDir != null && MapUtils.isNotEmpty(folderFileExtMap)) { | ||
String folderName = subDir.getFileName().toString(); | ||
if (folderFileExtMap.containsKey(folderName)) { | ||
subDir.register(watchService, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY); | ||
WatchKey registrationKey = subDir.register(watchService, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY); |
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.
see above
Adapting the code of AutomationWatchService to use relative path. This change was necessary after eclipse-archived#2432 was merged. Signed-off-by: Svilen Valkanov <svilen.valkanov@musala.com>
Adapting the code of AutomationWatchService to use relative path. This change was necessary after #2432 was merged. Signed-off-by: Svilen Valkanov <svilen.valkanov@musala.com>
Realted to: #2432 Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
See #2341
Fixes bug introduced by #1597 reverted with #1754.
The implementation of FolderObserver#processWatchEvent() does not get the file name correctly.
This led to duplicated directory names (see the logs in #1597).
AbstractWatchServiceTest is modified to run on different OS.
Signed-off-by: Svilen Valkanov svilen.valkanov@musala.com
svilenvul )