Class CmsInternalLinksValidator


  • public class CmsInternalLinksValidator
    extends java.lang.Object
    Util class to find broken links in a bundle of resources.

    Since:
    6.5.3
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<java.lang.String,​java.util.List<CmsRelation>> m_brokenRelations
      The internal computed broken relations map.
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsInternalLinksValidator​(CmsObject cms, java.util.List<java.lang.String> resourceNames)
      Creates a new helper object.
    • Field Detail

      • m_brokenRelations

        protected java.util.Map<java.lang.String,​java.util.List<CmsRelation>> m_brokenRelations
        The internal computed broken relations map.
    • Constructor Detail

      • CmsInternalLinksValidator

        public CmsInternalLinksValidator​(CmsObject cms,
                                         java.util.List<java.lang.String> resourceNames)
        Creates a new helper object.

        Parameters:
        cms - the cms object
        resourceNames - a list of resource names to be deleted
    • Method Detail

      • getBrokenLinksForResource

        public java.util.List<CmsRelationgetBrokenLinksForResource​(java.lang.String resourceName)
        Returns all broken links for the given resource.

        Parameters:
        resourceName - the resource to get the broken link
        Returns:
        a list of CmsRelation objects
      • getNotVisibleResourcesCount

        public int getNotVisibleResourcesCount()
        Returns the number of not visible resources with broken links.

        Returns:
        the number of not visible resources with broken links
      • isEmpty

        public boolean isEmpty()
        If no relation would be broken deleting the given resources.

        Returns:
        true if no relation would be broken deleting the given resources