Class FileLock

java.lang.Object
de.tsl2.nano.util.FileLock

public class FileLock extends Object
Creates an exclusive lock using the NIO channel functionality.
Version:
$Revision$
Author:
egu
  • Field Details

    • LOG

      protected static final org.apache.commons.logging.Log LOG
  • Constructor Details

    • FileLock

      public FileLock()
  • Method Details

    • lock

      public boolean lock(String dir, String file) throws IOException
      Parameters:
      dir - directory for file lock
      file - lock file name
      Returns:
      true, if lock was free
      Throws:
      IOException - if lock couldn't be done
    • releaseLock

      public void releaseLock()
      Release a possibly existing lock.