API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.nio.channels. FileLock View Source
Author(s)
Mark Reinhold
JSR-51 Expert Group
Since
1.4
Version
1.9, 05/11/17
Serial
Hierarchy
 Object
      FileLock
Implements
Subclasses
Description
publicabstract abstract class FileLock
  A token representing a lock on a region of a file.
See also:   
Constructors
protected FileLock (FileChannel channel, long position, long size, boolean shared)
  Initializes a new instance of this class.
Methods
Hide/Show inherited methods
publicfinal FileChannel channel ()
  Returns the file channel upon whose file this lock is held.
publicfinal boolean isShared ()
  Tells whether this lock is shared.
publicabstract boolean isValid ()
  Tells whether or not this lock is valid.
publicfinal boolean overlaps (long position, long size)
  Tells whether or not this lock overlaps the given lock range.
publicfinal long position ()
  Returns the position within the file of the first byte of the locked region.
publicabstract void release () throws IOException
  Releases this lock.
publicfinal long size ()
  Returns the size of the locked region in bytes.
publicfinal String toString ()
  Returns a string describing the range, type, and validity of this lock.
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar