net.sourceforge.cobertura.util
public class FileLocker extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
lock
An object of type FileLock, created using reflection.
|
private java.lang.Object |
lockChannel
An object of type FileChannel, created using reflection.
|
private java.io.File |
lockFile
A file called "filename.lock" that resides in the same directory
as "filename"
|
Constructor and Description |
---|
FileLocker(java.io.File file) |
Modifier and Type | Method and Description |
---|---|
private static java.lang.Object |
closeChannel(java.lang.Object channel) |
boolean |
lock()
Obtains a lock on the file.
|
void |
release()
Releases the lock on the file.
|
private static java.lang.Object |
releaseFileLock(java.lang.Object lock) |
private java.lang.Object lock
private java.lang.Object lockChannel
private java.io.File lockFile
public FileLocker(java.io.File file)
public boolean lock()
public void release()
private static java.lang.Object releaseFileLock(java.lang.Object lock)
private static java.lang.Object closeChannel(java.lang.Object channel)