Java Reference
In-Depth Information
/**
* Convert the specified String to a URL. If the string is
* too long or has other issues, throw a
* WorkloadException.
*
* @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
{
URL result = null;
url = url.trim();
if (url.length() > this.maxURLSize)
{
throw new WorkloadException(
"URL size is too big, must be under "
+ this.maxURLSize + " bytes.");
}
try
{
result = new URL(url);
} catch (MalformedURLException e)
{
throw new WorkloadException(e);
}
return result;
}
/**
* @return the connection
*/
public Connection getConnection()
{
return this.connection;
}
Search WWH ::




Custom Search