Skip to content

File Watcher Service, that monitors the file system and notify the listeners.

License

Notifications You must be signed in to change notification settings

varra4u/File-Watcher-Service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File-Watcher-Service

File Watcher Service, that monitors the file system and notify the listeners.

Maven artifact details:

<!-- https://mvnrepository.com/artifact/com.github.varra4u/file-watcher-service -->
<dependency>
    <groupId>com.github.varra4u</groupId>
    <artifactId>file-watcher-service</artifactId>
    <version>1.0.0</version>
</dependency>

To use this, just a single statement, you will start getting the notifications!

It provides a very flexible and convenient interface to monitor the file system:

log.info("Started the job directory watcher service, monitoring: {}", getRootJobDirPath());
FileWatcher watcher = FileWatcher.builder().interval(monitoringInterval)
         .initialScanNotificationRequired(false)
         .build()
         .registerListener(this::validateAndProcess, getRootJobDirPath().toString())
         .start();

.......
.......
watcher.shutdown();

About

File Watcher Service, that monitors the file system and notify the listeners.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages