Hi,
In a bit of a pickle at the moment, I'm doing a project which requires me to
- Input a web link
- download it's contents to file
- parse the content for all sites the site links to
- check each link individually to see if they are dead or alive, if dead return the response code
I have 1-3 done however one of the they are separate classes and I cant figure out how to get each link to pass to my checker class one by one.
Obviously I am not looking for a straight answer (I know how it works here!) but a nudge in the right direction would be great.
The 1st class downloads the links to a .txt file and they are displayed line by line like so:
http://boards.ie/vbulletin/newthread.php?do=newthread&f=25
https://mail.google.com/mail/
http://www.daft.ie/
In another class I can check one link for the response code....
if(
res.getResponseCode() == HttpURLConnection.HTTP_OK)
System.out.println("Connection is good Roger");
else
System.out.println("There were two Crabs, they work in pairs \n and the response code is \t"+res.getResponseCode());
Thanks.