Package org.apereo.cas.util.io
Class PathWatcherService
- java.lang.Object
-
- org.apereo.cas.util.io.PathWatcherService
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Runnable,WatcherService,org.springframework.beans.factory.DisposableBean
- Direct Known Subclasses:
FileWatcherService
public class PathWatcherService extends java.lang.Object implements WatcherService, java.lang.Runnable, java.io.Closeable, org.springframework.beans.factory.DisposableBean
Control watch operations on paths and files as a service.- Since:
- 5.2.0
-
-
Constructor Summary
Constructors Constructor Description PathWatcherService(java.io.File watchablePath, java.util.function.Consumer<java.io.File> onModify)PathWatcherService(java.nio.file.Path watchablePath, java.util.function.Consumer<java.io.File> onCreate, java.util.function.Consumer<java.io.File> onModify, java.util.function.Consumer<java.io.File> onDelete)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close.voiddestroy()voidrun()voidstart(java.lang.String name)Start the watch.
-
-
-
Constructor Detail
-
PathWatcherService
public PathWatcherService(java.io.File watchablePath, java.util.function.Consumer<java.io.File> onModify)
-
PathWatcherService
public PathWatcherService(java.nio.file.Path watchablePath, java.util.function.Consumer<java.io.File> onCreate, java.util.function.Consumer<java.io.File> onModify, java.util.function.Consumer<java.io.File> onDelete)
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
close
public void close()
Description copied from interface:WatcherServiceClose.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceWatcherService
-
start
public void start(java.lang.String name)
Description copied from interface:WatcherServiceStart the watch.- Specified by:
startin interfaceWatcherService- Parameters:
name- the name
-
destroy
public void destroy()
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
-