code: protected void setupStartFolder(String startFolder) {
  
          try {
              CmsObject cmsCopy = OpenCms.initCmsObject(m_cms);
              if (m_site.getValue() != null) {
                  cmsCopy.getRequestContext().setSiteRoot((String)m_site.getValue());
              } else {
                  cmsCopy.getRequestContext().setSiteRoot("");
              }
              m_startfolder.requireFolder();
              m_startfolder.disableSiteSwitch();
              m_startfolder.setValue(cmsCopy.getRequestContext().addSiteRoot(startFolder == null ? "/" : startFolder));
              m_startfolder.setCmsObject(cmsCopy);
              m_startfolder.setUseRootPaths(true);
              if (!m_visSites) {
                  try {
                      m_startfolder.setValue(
                          OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(cmsCopy, m_ou.getValue()).get(
                              0).getRootPath());
                  } catch (CmsException e1) {
                      LOG.error("unable to read resources for ou", e1);
                  }
              }
              m_startfolder.setEnabled(m_visSites);
          } catch (CmsException e) {
              LOG.error("Unable to ini CmsObject", e);
          }
      }
docs: Sets the start folder depending on current set site field.<p>
  
  @param startFolder default value or null