Java Reference
In-Depth Information
if (location1 == -1)
return null;
count--;
} while (count > 0);
// return the result from the original string that has mixed
// case
location2 = str.indexOf(token2, location1 + 1);
if (location2 == -1)
return null;
return str.substring(location1 + token1.length(), location2);
}
/**
* Scan the specified IP address and return the title of
* the web page found there, or null if no connection can
* be made.
*
* @param ip The IP address to scan.
* @return The title of the web page, or null if no website.
*/
private String scanIP(String ip)
{
try
{
System.out.println("Scanning: " + ip);
String page = downloadPage(new URL("http://" + ip), 1000);
String title = extractNoCase(page, "<title>",
"</title>", 0);
if (title == null)
title = "[Untitled site]";
return title;
} catch (IOException e)
{
return null;
}
}
Search WWH ::




Custom Search