code: private boolean isLocked(String path) {
  
          // get lock for path
          CmsRepositoryLockInfo lock = m_session.getLock(path);
          if (lock == null) {
              return false;
          }
  
          // check if found lock fits to the lock token from request
          //        String currentToken = "<opaquelocktoken:" + generateLockToken(req, lock) + ">";
          //        if (currentToken.equals(parseLockTokenHeader(req))) {
          //            return false;
          //        }
  
          if (lock.getUsername().equals(m_username)) {
              return false;
          }
  
          return true;
      }
docs: Check to see if a resource is currently write locked.<p>
  
  @param path the path where to find the resource to check the lock
  
  @return true if the resource is locked otherwise false