{"id":71011,"library":"directory-watcher","title":"Directory Watcher","description":"A Java library for watching file system directory changes using the WatchService API.","status":"active","version":"0.19.1","language":"java","source_language":null,"source_url":"https://github.com/gmethvin/directory-watcher","tags":["file-watching","directory","filesystem","utility"],"install":[{"cmd":"<dependency>\n  <groupId>io.methvin</groupId>\n  <artifactId>directory-watcher</artifactId>\n  <version>0.19.1</version>\n</dependency>","lang":"xml","label":"Maven"},{"cmd":"implementation 'io.methvin:directory-watcher:0.19.1'","lang":"groovy","label":"Gradle"}],"dependencies":[],"imports":[{"symbol":"DirectoryWatcher","correct":"io.methvin.watcher.DirectoryWatcher"}],"quickstart":{"code":"import io.methvin.watcher.DirectoryWatcher;\nimport java.nio.file.Paths;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        DirectoryWatcher watcher = DirectoryWatcher.builder()\n            .path(Paths.get(\"/path/to/watch\"))\n            .listener(event -> System.out.println(\"File changed: \" + event.path()))\n            .build();\n        watcher.watch();\n    }\n}","lang":"java","description":"Minimal usage of Directory Watcher"},"warnings":[{"fix":"Use DirectoryWatcher.builder().watchService(new PollingWatchService()) for macOS.","message":"On macOS, WatchService may have limitations; consider using polling mode.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'api':15 'chang':11 'directori':1,10,19 'file':8,17 'file-watch':16 'filesystem':20 'java':4 'librari':5 'system':9 'use':12 'util':21 'watch':7,18 'watcher':2 'watchservic':14","created_at":"2026-06-17T18:21:34.469519+00:00","updated_at":"2026-06-17T18:21:34.469519+00:00","problems":[],"ecosystem":"maven","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/gmethvin/directory-watcher","github":"https://github.com/gmethvin/directory-watcher","docs":"https://appdoc.app/artifact/io.methvin/directory-watcher/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-12-14","install_tag":null}}