@Override public Lock lockOrFail() throws SailLockedException {
  Lock lock=tryLock();
  if (lock != null) {
    return lock;
  }
  String requestedBy=getProcessName();
  String lockedBy=getLockedBy();
  if (lockedBy != null) {
    throw new SailLockedException(lockedBy,requestedBy,this);
  }
  lock=tryLock();
  if (lock != null) {
    return lock;
  }
  throw new SailLockedException(requestedBy);
}

@ Override public Lock lockOrFail ( ) throws SailLockedException { Lock lock = tryLock ( ) ; if ( lock != null ) { return lock ; } String requestedBy = getProcessName ( ) ; String lockedBy = getLockedBy ( ) ; if ( lockedBy != null ) { throw new SailLockedException ( lockedBy , requestedBy , this ) ; } lock = tryLock ( ) ; if ( lock != null ) { return lock ; } throw new SailLockedException ( requestedBy ) ; }
creates a lock in a directory if it does not yet exist .
