Java Reference
In-Depth Information
*
* @param url
* A String to convert into a URL.
* @return The URL.
* @throws WorkloadException
* Thrown if, The String could not be
* converted.
*/
public URL convertURL(String url) throws WorkloadException {
try {
return new URL(url);
} catch (MalformedURLException e) {
throw new WorkloadException(e);
}
}
/**
* Get the current host.
*
* @return The current host.
*/
public String getCurrentHost() {
return this.currentHost;
}
/**
* Get the depth of the specified URL.
*
* @param url
* The URL to get the depth of.
* @return The depth of the specified URL.
* @throws WorkloadException
* Thrown if the depth could not be found.
*/
public int getDepth(URL url) {
URLStatus s = this.workload.get(url);
assert (s != null);
if (s != null) {
return s.getDepth();
} else {
return 1;
}
}
Search WWH ::




Custom Search