Packages

c

zio.nio.file

WatchKey

final class WatchKey extends AnyRef

A token representing the registration of a watchable object with a WatchService.

Java NIO API.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WatchKey
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def cancel(implicit trace: Trace): UIO[Unit]

    Cancels the registration with the watch service.

    Cancels the registration with the watch service. Upon return the watch key will be invalid. If the watch key is enqueued, waiting to be retrieved from the watch service, then it will remain in the queue until it is removed. Pending events, if any, remain pending and may be retrieved by invoking the pollEvents method after the key is cancelled. If this watch key has already been cancelled then invoking this method has no effect. Once cancelled, a watch key remains forever invalid.

  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def isValid(implicit trace: Trace): UIO[Boolean]
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. def pollEvents(implicit trace: Trace): UIO[List[WatchEvent[_]]]

    Retrieves and removes all pending events for this watch key.

    Retrieves and removes all pending events for this watch key.

    This does not block, it will immediately return an empty list if there are no events pending. Typically, this key should be reset after processing the returned events, the pollEventsScoped method can be used to do this automatically and reliably.

  18. def pollEventsScoped(implicit trace: Trace): ZIO[Scope, Nothing, List[WatchEvent[_]]]

    Retrieves and removes all pending events for this watch key as a scoped resource.

    Retrieves and removes all pending events for this watch key as a scoped resource.

    This does not block, it will immediately return an empty list if there are no events pending. When the Scope is closed, this key will be reset.

  19. def reset(implicit trace: Trace): UIO[Boolean]

    Resets this watch key, making it eligible to be re-queued in the WatchService.

    Resets this watch key, making it eligible to be re-queued in the WatchService. A key is typically reset after all the pending events retrieved from pollEvents have been processed. Use pollEventsScop[ed to automatically and reliably perform a reset.

  20. def resolveEventPath(event: WatchEvent[_]): Option[Path]

    Convenience method to construct the complete path indicated by a WatchEvent.

    Convenience method to construct the complete path indicated by a WatchEvent.

    If both the following are true:

    1. This key's watchable is a filesystem path 2. The event has a path as its context

    then this method returns a path with the event's path resolved against this key's path, (key path) / (event path).

    If either of the above conditions don't hold, None is returned. The conditions will always hold when watching file system paths.

  21. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  26. def watchable: Watchable

    Returns the object for which this watch key was created.

Inherited from AnyRef

Inherited from Any

Ungrouped