Java Reference
In-Depth Information
/**
* Get the source page that contains the specified URL.
*
* @param url
* The URL to seek the source for.
* @return The source of the specified URL.
* @throws WorkloadException
* Thrown if the source of the specified URL
* could not be found.
*/
public URL getSource(URL url) throws WorkloadException
{
RepeatableStatement.Results rs = null;
try
{
rs = this.stmtGetSource.executeQuery(computeHash(url));
while (rs.getResultSet().next())
{
String u = rs.getResultSet().getString(1);
if (u.equals(url.toString()))
{
return (new URL(rs.getResultSet().getString(2)));
}
}
return null;
} catch (SQLException e)
{
throw (new WorkloadException(e));
} catch (MalformedURLException e)
{
throw (new WorkloadException(e));
} finally
{
if (rs != null)
{
rs.close();
}
}
}
/**
* Get a new URL to work on. Wait if there are no URL's
* currently available. Return null if done with the
* current host. The URL being returned will be marked as
* in progress.
*
Search WWH ::




Custom Search