}
protected String getRedirectLocation(String location)
{
ArgumentUtility.validateNotEmpty("location", location);
ResourceURLProvider provider = getResponseContext().getResourceURLProvider();
if (location.indexOf("://") != -1)
{
provider.setAbsoluteURL(location);
}
else
{
provider.setFullPath(location);
}
location = getServletResponse().encodeRedirectURL(provider.toString());
if (location.indexOf("/") == -1)
{
throw new IllegalArgumentException("There is a relative path given, an IllegalArgumentException must be thrown.");
}
return location;