Here is my code, I can't get the lockFile to delete, any ideas?
FILE 1
public static final File lockFile = new File("c:/fileLock");
public static FileLock lock = null;
public void aR()
{
try
{
FileChannel channel = new RandomAccessFile(lockFile, "rw").
getChannel();
try
{
lock = channel.tryLock();
if (lock == null)
{
System.exit(0);
}
} catch (OverlappingFileLockException e)
{
}
} catch (Exception e)
{
}
}
FILE 2
public void clean() {
try
{
manager.lock.release();
} catch (IOException ioe)
{}
manager.lockFile.delete();
}
Message was edited by:
javarob