インタフェース
java.nio.file.WatchServiceの使用
| パッケージ | 説明 |
|---|---|
| java.nio.file |
ファイル、ファイル属性、およびファイル・システムにアクセスするためのJava仮想マシン用のインタフェースとクラスを定義します。
|
-
java.nio.fileでのWatchServiceの使用
WatchServiceを返すjava.nio.fileのメソッド 修飾子と型 メソッド 説明 abstract WatchServiceFileSystem. newWatchService()新しいWatchServiceを構築します(オプションの操作)。型WatchServiceのパラメータを持つjava.nio.fileのメソッド 修飾子と型 メソッド 説明 default WatchKeyPath. register(WatchService watcher, WatchEvent.Kind<?>... events)このパスで検出されたファイルを監視サービスに登録します。WatchKeyPath. register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers)このパスで検出されたファイルを監視サービスに登録します。WatchKeyWatchable. register(WatchService watcher, WatchEvent.Kind<?>... events)オブジェクトを監視サービスに登録します。WatchKeyWatchable. register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers)オブジェクトを監視サービスに登録します。