code: private CmsDeleteResourceBean getBrokenLinks(CmsResource entryResource) throws CmsException {
  
          CmsDeleteResourceBean result = null;
  
          CmsListInfoBean info = null;
          List<CmsBrokenLinkBean> brokenLinks = null;
  
          CmsObject cms = getCmsObject();
          String resourceSitePath = cms.getSitePath(entryResource);
  
          ensureSession();
  
          List<CmsResource> descendants = new ArrayList<CmsResource>();
          HashSet<CmsUUID> deleteIds = new HashSet<CmsUUID>();
  
          descendants.add(entryResource);
          if (entryResource.isFolder()) {
              descendants.addAll(cms.readResources(resourceSitePath, CmsResourceFilter.IGNORE_EXPIRATION));
          }
  
          for (CmsResource deleteRes : descendants) {
              deleteIds.add(deleteRes.getStructureId());
          }
          Multimap<CmsResource, CmsResource> linkMap = HashMultimap.create();
          for (CmsResource resource : descendants) {
              List<CmsRelation> relations = cms.getRelationsForResource(resource, CmsRelationFilter.SOURCES);
              List<CmsResource> result1 = new ArrayList<CmsResource>();
              for (CmsRelation relation : relations) {
                  // only add related resources that are not going to be deleted
                  if (!deleteIds.contains(relation.getSourceId())) {
                      CmsResource source1 = relation.getSource(cms, CmsResourceFilter.ALL);
                      if (!source1.getState().isDeleted()) {
                          result1.add(source1);
                      }
                  }
              }
              List<CmsResource> linkSources = result1;
              for (CmsResource source : linkSources) {
                  linkMap.put(source, resource);
              }
          }
  
          brokenLinks = getBrokenLinkBeans(linkMap);
          info = getPageInfo(entryResource);
  
          result = new CmsDeleteResourceBean(resourceSitePath, info, brokenLinks);
  
          return result;
      }
docs: Internal method to get the broken links information for the given resource.<p>
  
  @param entryResource the resource
  
  @return the broken links information
  
  @throws CmsException if something goes wrong