Java Reference
In-Depth Information
form.complete();
http.getInputStream();
String query = http.getURL().getQuery();
if (query != null)
{
Map<String, String> map = FormUtility.parse(query);
return map.get("session");
} else
return null;
}
/** Advance to the specified HTML tag.
* @param parse The HTML parse object to use.
* @param tag The HTML tag.
* @param count How many tags like this to find.
* @return True if found, false otherwise.
* @throws IOException If an exception occurs while reading.
*/
private boolean advance(ParseHTML parse, String tag, int count)
throws IOException
{
int ch;
while ((ch = parse.read()) != -1)
{
if (ch == 0)
{
if (parse.getTag().getName().equalsIgnoreCase(tag))
{
count--;
if (count <= 0)
return true;
}
}
}
return false;
}
/**
* Use the session to search for the specified state or
* capital. The search
* method can be called multiple times per login.
* @param session The session to use.
* @param search The search string to use.
* @param type What to search for(s=state,c=capital).
* @return A list of states or capitals.
* @throws IOException Thrown if a communication failure occurs
Search WWH ::




Custom Search