Code example for FileLock

Methods: isValidrelease

0
     * Releases the lock 
     * 
     * @throws IOException if an error occurred while trying to unlock 
     */ 
    public void release() throws IOException { 
        if (lock.isValid()) {
            lock.release();
        } 
        if (lockStream != null) {
            lockStream.close();
        } 
        if (lockChannel.isOpen()) {
            lockChannel.close();
        } 
    } 
}