Documentation for this section has not yet been entered.
Type Reason Java.Nio.Channels.ClosedChannelException the file channel is closed. Java.Nio.Channels.NonWritableChannelException this channel was not opened for writing. Java.Nio.Channels.OverlappingFileLockException either a lock is already held that overlaps this lock request, or another thread is waiting to acquire a lock that will overlap with this request. Java.Nio.Channels.FileLockInterruptionException the calling thread was interrupted while waiting to acquire the lock. Java.Nio.Channels.AsynchronousCloseException the channel was closed while the calling thread was waiting to acquire the lock. Java.IO.IOException if another I/O error occurs while obtaining the requested lock.
Obtains an exclusive lock on this file.
This is a convenience method for acquiring a maximum length lock on a file. It is equivalent to: fileChannel.lock(0L, Long.MAX_VALUE, false);