Code example for FileLock

Methods: release

0
        } 
 
        // release the lock.. 
        if (lock != null) {
            try { 
                lock.release();
                System.getProperties().remove(getVmLockKey());
            } catch (Throwable ignore) {
            } 
            lock = null;
        } 
        closeReadFile(); 
 
        if (deleteOnUnlock) {
            file.delete();
        } 
    } 
 
    private String getVmLockKey() throws IOException {
        return getClass().getName() + ".lock." + file.getCanonicalPath();