code: private void lockResource(String resourcename, CmsLockType type) throws CmsException {
  
          // throw the exception if resource name is an empty string
          if (CmsStringUtil.isEmptyOrWhitespaceOnly(resourcename)) {
              throw new CmsVfsResourceNotFoundException(
                  Messages.get().container(Messages.ERR_LOCK_RESOURCE_1, resourcename));
          }
          CmsResource resource = readResource(resourcename, CmsResourceFilter.ALL);
          getResourceType(resource).lockResource(this, m_securityManager, resource, type);
      }
docs: Locks a resource.<p>
  
  The <code>type</code> parameter controls what kind of lock is used.<br>
  Possible values for this parameter are: <br>
  <ul>
  <li><code>{@link org.opencms.lock.CmsLockType#EXCLUSIVE}</code></li>
  <li><code>{@link org.opencms.lock.CmsLockType#TEMPORARY}</code></li>
  </ul><p>
  
  @param resourcename the name of the resource to lock (full current site relative path)
  @param type type of the lock
  
  @throws CmsException if something goes wrong