code: private void executeLock( final ITransaction transaction, final WebdavRequest req, final WebdavResponse resp )
          throws LockFailedException, IOException, WebdavException
      {
  
          // Mac OS lock request workaround
          if ( _macLockRequest )
          {
              LOG.trace( "DoLock.execute() : do workaround for user agent '" + _userAgent + "'" );
  
              doMacLockRequestWorkaround( transaction, req, resp );
          }
          else
          {
              // Getting LockInformation from request
              if ( getLockInformation( transaction, req, resp ) )
              {
                  final int depth = getDepth( req );
                  final int lockDuration = getTimeout( transaction, req );
  
                  boolean lockSuccess = false;
                  if ( _exclusive )
                  {
                      lockSuccess = _resourceLocks.exclusiveLock( transaction, _path, _lockOwner, depth, lockDuration );
                  }
                  else
                  {
                      lockSuccess = _resourceLocks.sharedLock( transaction, _path, _lockOwner, depth, lockDuration );
                  }
  
                  if ( lockSuccess )
                  {
                      // Locks successfully placed - return information about
                      final LockedObject lo = _resourceLocks.getLockedObjectByPath( transaction, _path );
                      if ( lo != null )
                      {
                          generateXMLReport( transaction, resp, lo );
                      }
                      else
                      {
                          resp.sendError( SC_INTERNAL_SERVER_ERROR );
                      }
                  }
                  else
                  {
                      sendLockFailError( transaction, req, resp );
  
                      throw new LockFailedException();
                  }
              }
              else
              {
                  // information for LOCK could not be read successfully
                  resp.setContentType( "text/xml; charset=UTF-8" );
                  resp.sendError( SC_BAD_REQUEST );
              }
          }
      }
docs: Executes the LOCK