code: public void createSharedFolder() throws Exception {
  
          String originalSiteRoot = m_cms.getRequestContext().getSiteRoot();
          CmsProject originalProject = m_cms.getRequestContext().getCurrentProject();
          try {
              m_cms.getRequestContext().setSiteRoot("");
              m_cms.getRequestContext().setCurrentProject(m_cms.createTempfileProject());
              if (!m_cms.existsResource("/shared")) {
                  m_cms.createResource("/shared", OpenCms.getResourceManager().getResourceType("folder"));
              }
  
              try {
                  m_cms.lockResourceTemporary("/shared");
              } catch (CmsException e) {
                  LOG.error(e.getLocalizedMessage(), e);
              }
              try {
                  m_cms.chacc("/shared", "group", "Users", "+v+w+r+i");
              } catch (CmsException e) {
                  LOG.error(e.getLocalizedMessage(), e);
              }
              CmsResource shared = m_cms.readResource("/shared");
              try {
                  OpenCms.getPublishManager().publishProject(
                      m_cms,
                      new CmsHtmlReport(m_cms.getRequestContext().getLocale(), m_cms.getRequestContext().getSiteRoot()),
                      shared,
                      false);
                  OpenCms.getPublishManager().waitWhileRunning();
              } catch (CmsException e) {
                  LOG.error(e.getLocalizedMessage(), e);
              }
          } finally {
              m_cms.getRequestContext().setSiteRoot(originalSiteRoot);
              m_cms.getRequestContext().setCurrentProject(originalProject);
          }
  
      }
docs: Creates the shared folder if possible.<p>
  
  @throws Exception if something goes wrong