code: public static boolean isNavLevelFolder(CmsObject cms, CmsResource resource) {
  
          if (resource.isFolder()) {
              I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(resource);
              if (CmsResourceTypeFolder.RESOURCE_TYPE_NAME.equals(type.getTypeName())) {
                  try {
                      CmsProperty prop = cms.readPropertyObject(
                          resource,
                          CmsPropertyDefinition.PROPERTY_DEFAULT_FILE,
                          false);
                      return !prop.isNullProperty() && NAVIGATION_LEVEL_FOLDER.equals(prop.getValue());
                  } catch (CmsException e) {
                      LOG.debug(e.getMessage(), e);
                  }
              }
          }
          return false;
      }
docs: Returns whether the given resource is a folder and is marked to be a navigation level folder.<p>
  
  @param cms the cms context
  @param resource the resource
  
  @return <code>true</code> if the resource is marked to be a navigation level folder