Package name.pachler.nio.file.impl
Class PollingPathWatchService
java.lang.Object
name.pachler.nio.file.WatchService
name.pachler.nio.file.impl.PathWatchService
name.pachler.nio.file.impl.PollingPathWatchService
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Field Summary
Fields inherited from class name.pachler.nio.file.impl.PathWatchService
FLAG_ACCURATE, FLAG_FILTER_ENTRY_CREATE, FLAG_FILTER_ENTRY_DELETE, FLAG_FILTER_ENTRY_MODIFY, FLAG_FILTER_ENTRY_RENAME_FROM, FLAG_FILTER_ENTRY_RENAME_TO, FLAG_FILTER_KEY_INVALID, FLAG_WATCH_SUBTREE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
long
poll()
register
(Path path, WatchEvent.Kind<?>[] kinds, WatchEvent.Modifier[] modifiers) boolean
reset
(PathWatchKey pathWatchKey) void
setPollInterval
(long pollInterval) take()
Methods inherited from class name.pachler.nio.file.impl.PathWatchService
checkAndCastToPathImpl, makeFlagMask
-
Constructor Details
-
PollingPathWatchService
public PollingPathWatchService()
-
-
Method Details
-
register
public PathWatchKey register(Path path, WatchEvent.Kind<?>[] kinds, WatchEvent.Modifier[] modifiers) throws IOException - Specified by:
register
in classPathWatchService
- Throws:
IOException
-
reset
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWatchService
- Throws:
IOException
-
poll
- Specified by:
poll
in classWatchService
- Throws:
InterruptedException
ClosedWatchServiceException
-
poll
public WatchKey poll(long timeout, TimeUnit unit) throws InterruptedException, ClosedWatchServiceException - Specified by:
poll
in classWatchService
- Throws:
InterruptedException
ClosedWatchServiceException
-
take
- Specified by:
take
in classWatchService
- Throws:
InterruptedException
ClosedWatchServiceException
-
getPollInterval
public long getPollInterval() -
setPollInterval
public void setPollInterval(long pollInterval)
-