Broken Link Detector A broken link is an url that references a non-existing document. Broken links are an indicator of poor quality of web pages. Modify the web crawler in the textbook (shown below) such that it identifies and outputs broken links on the website of a given URL. A link can have a full name, win http://www.cnn. com/index.html, or a short name that is relative to the hosting page, as in import java.util.Scanner: import java.util.ArrayList; public class WebCrawler ( public static void main(String() args) { Scanner input = new Scanner(System.in); System.out.print("Enter a URL: "); String url - input.nextLine(); crawler(url); // Traverse the web from the a starting url 3 public static void crawler (String starting URL) { ArrayList list of Pending URLs - new ArrayListo: ArrayList list.OfTraversedURLs - new ArrayLint>(): listof Pending URLs.add(starting URL): while (!istof Pending URLs. IsEmpty & 11stOfTraversedURLs.size() <= 100) String urlstring - listofPending URLs.remove(o): lint of TraversedURLD.add(urlstring); System.out.println("Crawl" .urlstring) for (String or getSubURLs (urlString)) { 11 (Ilist of TraversedURLs.contains(s) et HistOf Pending URLs.contains (s)) listOfPending URLs.add(s); ) > 3 public static ArrayList gotSubURLE (String urlString) { ArrayList list = new ArrayListo: try { java.net. URL url - new java.net. URL (ur String); Scanner input = new Scanner(url openStrean()); int current = 0; while (input has ext()) { String line - input.nextLine(); current - line.indexOf('http:'. current): while (current > 0) { int endIndex - line. Indexor (current): if (endIndex > 0) { // Ensure that a correct URL is found list.add(line.substring(current, and Index)); current - line.indexOf("http:.endIndex): > public static ArrayList 0) { int endodex - line.indexOf(".current); if (endIndex > 0) { // neure that correct URL is found list.add(line subtring(current, endade)); current - line.inder of 'http", endIndex); > 1 else current = -1: > catch (Exception e) { System.out.println("Error: " + ex.getMessage()); 3 return list;