code: protected boolean checkLocks( final ITransaction transaction, final WebdavRequest req, final WebdavResponse resp,
                                    final IResourceLocks resourceLocks, final String path )
          throws IOException, LockFailedException
      {
  
          LockedObject loByPath = resourceLocks.getLockedObjectByPath( transaction, path );
          if ( loByPath != null )
          {
  
              if ( loByPath.isShared() )
              {
                  return true;
              }
  
              // the resource is locked
              final String[] lockTokens = getLockIdFromIfHeader( req );
              String lockToken = null;
              if ( lockTokens != null )
              {
                  lockToken = lockTokens[0];
              }
              else
              {
                  return false;
              }
              if ( lockToken != null )
              {
                  LockedObject loByIf = resourceLocks.getLockedObjectByID( transaction, lockToken );
                  if ( loByIf == null )
                  {
                      // no locked resource to the given lockToken
                      return false;
                  }
                  if ( !loByIf.equals( loByPath ) )
                  {
                      loByIf = null;
                      return false;
                  }
                  loByIf = null;
              }
  
          }
          loByPath = null;
          return true;
      }
docs: Checks if locks on resources at the given path exists and if so checks
  the If-Header to make sure the If-Header corresponds to the locked
  resource. Returning true if no lock exists or the If-Header is
  corresponding to the locked resource
  
  @param req
  Servlet request
  @param resp
  Servlet response
  @param resourceLocks
  @param path
  path to the resource
  @return true if no lock on a resource with the given path exists or if
  the If-Header corresponds to the locked resource
  @throws IOException
  @throws LockFailedException