Package de.tsl2.nano.util
Class FileLock
java.lang.Object
de.tsl2.nano.util.FileLock
Creates an exclusive lock using the NIO channel functionality.
- Version:
- $Revision$
- Author:
- egu
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidRelease a possibly existing lock.
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOG
-
-
Constructor Details
-
FileLock
public FileLock()
-
-
Method Details
-
lock
- Parameters:
dir- directory for file lockfile- 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.
-