Attempts to acquire an exclusive lock on this file without blocking.
This is a convenience method for attempting to acquire a maximum length lock on the file. It is equivalent to:
fileChannel.tryLock(0L, Long.MAX_VALUE, false)
The method returns null
if the acquisition would result in an overlapped lock with another OS process.
@return the file lock object, or
null
if the lock wouldoverlap an existing exclusive lock in another OS process.
@throws ClosedChannelException the file channel is closed.
@throws 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.
@throws IOException if any I/O error occurs