public void release ( ) throws Exception { synchronized ( this ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Releasing lock on " + lockFile . getAbsolutePath ( ) ) ; } if ( fileLock != null ) { try { fileLock . release ( ) ; fileLock = null ; } catch ( Exception e ) { throw new Exception ( "Unable to release locked file: " + lockFile . getAbsolutePath ( ) , e ) ; } if ( fileChannel != null ) { try { fileChannel . close ( ) ; } catch ( IOException e ) { // ignore } fileChannel = null ; } if ( lockFile != null ) { if ( lockFile . exists ( ) ) { lockFile . delete ( ) ; } lockFile = null ; } } } }
Releases the lock .