code: public void changeSite(String siteRoot, String path, boolean force) {
  
          CmsObject cms = A_CmsUI.getCmsObject();
          String currentSiteRoot = cms.getRequestContext().getSiteRoot();
          if (force || !currentSiteRoot.equals(siteRoot)) {
              CmsAppWorkplaceUi.get().changeSite(siteRoot);
              if (path == null) {
                  path = m_locationCache.getFileExplorerLocation(siteRoot);
                  if (CmsStringUtil.isEmptyOrWhitespaceOnly(siteRoot)
                      && ((path == null) || !path.startsWith("/system"))) {
                      // switching to the root site and previous root site folder is not below /system
                      // -> stay in the current folder
                      path = m_locationCache.getFileExplorerLocation(currentSiteRoot);
                      if (path != null) {
                          path = CmsStringUtil.joinPaths(currentSiteRoot, path);
                      }
                  }
              }
              openPath(path, true);
              Container container = m_siteSelector.getContainerDataSource();
              for (Object id : container.getItemIds()) {
                  String key = (String)id;
                  if (CmsStringUtil.comparePaths(key, siteRoot)) {
                      siteRoot = key;
                      break;
                  }
              }
              m_siteSelector.select(siteRoot);
          }
      }
docs: Switches to the requested site.<p>
  
  @param siteRoot the site root
  @param path the folder path to open
  @param force force the path change, even if we are currently in the same site