|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectwave.utility.FileLock
Write an int to the head of a RandomAccessFile to mark it as locked.
Constructor Summary | |
FileLock()
|
Method Summary | |
static void |
getLock(java.io.RandomAccessFile file)
Lock the provided file by setting the first int of the file to be a random number. |
static void |
main(java.lang.String[] args)
Both an example and a utility to manually release the lock. |
static void |
releaseLock(java.io.RandomAccessFile file)
Mark the initial int of a RandomAccessFile as a zero. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileLock()
Method Detail |
public static void main(java.lang.String[] args)
public static void releaseLock(java.io.RandomAccessFile file) throws java.io.IOException
java.io.IOException
public static void getLock(java.io.RandomAccessFile file) throws java.io.IOException
file
- java.io.RandomAccessFile The file to be locked.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |