public class FileLocker
extends java.lang.Object
| Constructor | Description |
|---|---|
FileLocker(java.io.File lockFile) |
Instantiates a new FileLocker.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
lock() |
Try to lock the file and return true if the locking succeeds.
|
void |
release() |
Releases the lock.
|
public FileLocker(java.io.File lockFile)
lockFile - the file to lockpublic boolean lock()
throws java.lang.Exception
java.lang.Exception - if the lock could not be obtained for any reasonpublic void release()
throws java.lang.Exception
java.lang.Exception - if the lock could not be released for any reasonCopyright © 2008–2018 The Aspectran Project. All rights reserved.