docs: private CmsJspNavElement getNavigationForResource(
          String sitePath,
          CmsResourceFilter resourceFilter,
          boolean shallow) {
  
          CmsResource resource;
          Map<String, String> propertiesMap;
          int level = CmsResource.getPathLevel(sitePath);
          if (sitePath.endsWith("/")) {
              level--;
          }
          try {
              resource = m_cms.readResource(sitePath, resourceFilter);
              List<CmsProperty> properties = m_cms.readPropertyObjects(resource, false);
              propertiesMap = CmsProperty.toMap(properties);
              if (resource.isFolder()) {
                  if (resourceFilter.equals(CmsResourceFilter.DEFAULT)
                      && !NAVIGATION_LEVEL_FOLDER.equals(
                          propertiesMap.get(CmsPropertyDefinition.PROPERTY_DEFAULT_FILE))) {
                      try {
                          CmsResource defaultFile = m_cms.readDefaultFile(resource, resourceFilter);
                          if ((defaultFile != null)
                              && !defaultFile.isReleasedAndNotExpired(m_cms.getRequestContext().getRequestTime())) {
                              // do not show navigation entries for unreleased or expired resources
                              return null;
                          }
                      } catch (@SuppressWarnings("unused") CmsException e) {
                          // may happen if permissions are not sufficient can be ignored
                      }
                  }
                  if (!sitePath.endsWith("/")) {
                      sitePath = sitePath + "/";
                  }
                  if (!shallow
                      && (NAVIGATION_LEVEL_FOLDER.equals(
                          propertiesMap.get(CmsPropertyDefinition.PROPERTY_DEFAULT_FILE)))) {
                      // this folder is marked as a navigation level, set the site path to the first sub element
                      List<CmsJspNavElement> subElements = getNavigationForFolder(sitePath, false, resourceFilter, true);
                      if (!subElements.isEmpty()) {
                          CmsJspNavElement subElement = subElements.get(0);
                          subElement = getNavigationForResource(subElement.getSitePath(), resourceFilter, false);
                          sitePath = subElement.getSitePath();
                      }
                  }
              }
          } catch (Exception e) {
              // may happen if permissions are not sufficient
              LOG.warn(e.getLocalizedMessage(), e);
              return null;
          }
  
          return new CmsJspNavElement(sitePath, resource, propertiesMap, level, m_locale);
      }