code: public void updateSite(CmsObject cms, CmsSite oldSite, CmsSite newSite) throws CmsException {
  
          if (oldSite != null) {
              // remove the old site
              removeSite(cms, oldSite);
          }
  
          if (newSite != null) {
              // add the new site
              addSite(cms, newSite);
          }
      }
docs: Updates or creates a site.<p>
  
  @param cms the CMS object
  @param oldSite the site to remove if not <code>null</code>
  @param newSite the site to add if not <code>null</code>
  
  @throws CmsException if something goes wrong