Listen to java change folder

Is there a way to listen to a folder or a specific directory using the Quartz api in java? if possible, and if you have code for it. Please share

+4
source share
3 answers

If you use JDK 7, they provide new APIs for this .

+5
source

Try the Apache Commons IO api and it should do the trick.

+1
source

In fact, Quartz has built-in jobs ... job:

  • DirectoryScanJob :

    It checks the directory and compares whether any recent "dated dates" of any files have changed since the last time it was checked. If one or more files have been updated (or created), the job calls the callback method

  • FileScanJob

    Checks the file and compares whether the "last modified date" has changed since the last check. If the file has been updated, the job calls the callback method

+1
source

Source: https://habr.com/ru/post/1397726/


All Articles