Question: Using Java: How to Implement? Create a new class named URLWrapper with the following: 1 . Two private data members: final URL url and int

Using Java:
How to Implement?
Create a new class named URLWrapper with the following:
1. Two private data members: final URL url and int count.
2. Constructor: creates URL object with a parameter and assign it to the private member url.
3. Getter methods for private data members:
protected URL getURL()
protected int getCount()
4. The findCount method finds the number of occurrences of the user-specified search keyword in the HTML file.
Set up buffered reader.
Read from URL and count the number of occurrences of keyword.
protected void findCount(String key)
5. The extractInnerURL method gets inner URLs.
For the inner links, may use the regular expression: "href=\"((http|https):\\/\\/.*)\""
protected ArrayList extractInnerURLS(String key)
Procedures:
1. Get input from the user: base URL and search keyword from the console.
2. Get the total occurrence of search keyword for base URL.
3. Get inner URLs.
4. Get the total occurrence of search keyword for each inner URL.
5. Sort the inner URLs in descending order by count.
6. Print result to screen and write to file.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!