Package org.opencms.relations
Class CmsInternalLinksValidator
- java.lang.Object
-
- org.opencms.relations.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<CmsRelation>
getBrokenLinksForResource(java.lang.String resourceName)
Returns all broken links for the given resource.int
getNotVisibleResourcesCount()
Returns the number of not visible resources with broken links.java.util.List<CmsResource>
getResourcesWithBrokenLinks()
Returns all resources with broken links.boolean
isEmpty()
If no relation would be broken deleting the given resources.
-
-
-
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 objectresourceNames
- a list of resource names to be deleted
-
-
Method Detail
-
getBrokenLinksForResource
public java.util.List<CmsRelation> getBrokenLinksForResource(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
-
getResourcesWithBrokenLinks
public java.util.List<CmsResource> getResourcesWithBrokenLinks()
Returns all resources with broken links.- Returns:
- a list of
CmsResource
objects
-
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
-
-