private void createLock() throws IOException {
synchronized (LockableFileWriter.class) {
    if (!lockFile.createNewFile()) {
      throw new IOException("Can't write file, lock " + lockFile.getAbsolutePath() + " exists");
    }
    lockFile.deleteOnExit();
  }
}

private void createLock ( ) throws IOException { synchronized ( LockableFileWriter . class ) { if ( ! lockFile . createNewFile ( ) ) { throw new IOException ( "Can't write file, lock " + lockFile . getAbsolutePath ( ) + " exists" ) ; } lockFile . deleteOnExit ( ) ; } }
creates the lock file .
