About Question enthuware.ocpjp.v7.2.1519 :
Moderator: admin
-
- Posts: 22
- Joined: Mon Jul 06, 2015 11:45 am
- Contact:
About Question enthuware.ocpjp.v7.2.1519 :
where can i read about WatchService and possible counts of events?
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
-
- Posts: 23
- Joined: Sun Feb 21, 2016 10:12 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1519 :
What do you exactly try to mean by "The counts for ENTRY_CREATE and ENTRY_DELETE are exactly 1"? Does it mean that at a time we can have only one entry_create event queued?
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1519 :
When you get a WatchEvent object, you can call its count() method to find out the number of times that event has occurred. However, if the event is for creation or deletion of a directory, then this method always returns 1.
Try playing with some sample code to understand this better: http://www.codejava.net/java-se/file-io ... ervice-api
Try playing with some sample code to understand this better: http://www.codejava.net/java-se/file-io ... ervice-api
-
- Posts: 29
- Joined: Wed Apr 17, 2013 9:22 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1519 :
In explanation:
WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events) throws IOException
Second argument is actually a vararg, should be "WatchEvent.Kind<?>... events".
https://docs.oracle.com/javase/7/docs/a ... hable.html
WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events) throws IOException
Second argument is actually a vararg, should be "WatchEvent.Kind<?>... events".
https://docs.oracle.com/javase/7/docs/a ... hable.html
Who is online
Users browsing this forum: No registered users and 4 guests