public class LockFile
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Method and Description |
---|---|
void |
close() |
static LockFile |
createLock(java.io.File file)
Create an exclusive lock on the specified file.
|
static LockFile |
createLock(java.io.File file,
boolean shared)
Create an exclusive lock on the specified file.
|
public static LockFile createLock(java.io.File file)
file
- the file.public static LockFile createLock(java.io.File file, boolean shared)
file
- the file.shared
- true
to request a shared lock, false
to
request an exclusive lockpublic void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable