IWatchKey.Watchable Method

Definition

Returns the object for which this watch key was created.

[Android.Runtime.Register("watchable", "()Ljava/nio/file/Watchable;", "GetWatchableHandler:Java.Nio.FileNio.IWatchKeyInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public Java.Nio.FileNio.IWatchable? Watchable ();
[<Android.Runtime.Register("watchable", "()Ljava/nio/file/Watchable;", "GetWatchableHandler:Java.Nio.FileNio.IWatchKeyInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member Watchable : unit -> Java.Nio.FileNio.IWatchable

Returns

the object for which this watch key was created

Attributes

Remarks

Returns the object for which this watch key was created. This method will continue to return the object even after the key is cancelled.

As the WatchService is intended to map directly on to the native file event notification facility (where available) then many of details on how registered objects are watched is highly implementation specific. When watching a directory for changes for example, and the directory is moved or renamed in the file system, there is no guarantee that the watch key will be cancelled and so the object returned by this method may no longer be a valid path to the directory.

Java documentation for java.nio.file.WatchKey.watchable().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to