final class FileLock extends AnyRef
A token representing a lock on a region of a file. A file-lock object is created each time a lock is acquired on a
file via one of the lock
or tryLock
methods of the FileChannel
class, or the lock
or tryLock
methods of the
AsynchronousFileChannel
class.
- Alphabetic
- By Inheritance
- FileLock
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def acquiredBy: Channel
The channel upon whose file this lock was acquired.
The channel upon whose file this lock was acquired. If the underlying NIO channel is a standard channel type, the appropriate ZIO-NIO wrapper class is returned, otherwise a generic zio.nio.channels.Channel is returned.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isShared: Boolean
Tells whether this lock is shared.
- def isValid(implicit trace: Trace): UIO[Boolean]
Tells whether or not this lock is valid.
Tells whether or not this lock is valid. A lock object remains valid until it is released or the associated file channel is closed, whichever comes first.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def overlaps(position: Long, size: Long): Boolean
Tells whether or not this lock overlaps the given lock range.
Tells whether or not this lock overlaps the given lock range.
- position
The starting position of the lock range
- size
The size of the lock range
- def position: Long
Returns the position within the file of the first byte of the locked region.
Returns the position within the file of the first byte of the locked region. A locked region need not be contained within, or even overlap, the actual underlying file, so the value returned by this method may exceed the file's current size.
- def release(implicit trace: Trace): IO[IOException, Unit]
- def size: Long
Returns the size of the locked region in bytes.
Returns the size of the locked region in bytes. A locked region need not be contained within, or even overlap, the actual underlying file, so the value returned by this method may exceed the file's current size.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()