code: public String getFolderPath(CmsObject cms, String pageFolderPath) {
  
          if (m_folder != null) {
              try {
                  return OpenCms.getADEManager().getRootPath(
                      m_folder.getStructureId(),
                      cms.getRequestContext().getCurrentProject().isOnlineProject());
              } catch (CmsException e) {
                  LOG.error(e.getLocalizedMessage(), e);
                  return m_folder.getRootPath();
              }
          } else if (m_basePath != null) {
              return CmsStringUtil.joinPaths(m_basePath, m_folderName);
          } else if (m_isPageRelative) {
              if (pageFolderPath == null) {
                  throw new IllegalArgumentException(
                      "getFolderPath called without page folder, but pageRelative is enabled!");
              }
              return CmsStringUtil.joinPaths(pageFolderPath, ELEMENTS_FOLDER_NAME);
          } else {
              return CmsStringUtil.joinPaths(
                  cms.getRequestContext().getSiteRoot(),
                  CmsADEManager.CONTENT_FOLDER_NAME,
                  m_folderName);
          }
  
      }
docs: Computes the folder root path.<p>
  
  @param cms the CMS context to use
  @param pageFolderPath the root path of the folder containing the current container page
  @return the folder root path