HttpURLConnection has a method called getResponseCode() and returns 200 if its a valid page. Once you parse the links from the HTML source, you can put them into a list and iterate through the list of urls to see if they are valid. Here is a method that you could use. My Java skills are a bit rusty so bare with me.
public bool isValidUrl(String urlStr)
{
try
{
java.net.URL url = new java.net.URL(urlStr);
java.net.HttpURLConnection httpConn = (java.net.HttpURLConnection)url.openConnection();
httpConn.connect();
if(httpConn.getResponseCode() != 200)
return false;
else
return true; //it does return 200 and is a valid link
}
catch(Exception e)
{
e.printStackTrace();
}
}