org.apache.cactus.internal.client
public class: WebResponseObjectFactory [javadoc |
source]
java.lang.Object
org.apache.cactus.internal.client.WebResponseObjectFactory
All Implemented Interfaces:
ResponseObjectFactory
Constructs Web response objects. Supports both Cactus
org.apache.cactus.WebResponse and HttpUnit
com.meterware.httpunit.WebResponse response object creation.
- version:
$ - Id: WebResponseObjectFactory.java 293031 2005-10-01 22:00:33Z nchalumeau $
| Method from org.apache.cactus.internal.client.WebResponseObjectFactory Summary: |
|---|
|
getResponseObject |
| Method from org.apache.cactus.internal.client.WebResponseObjectFactory Detail: |
public Object getResponseObject(String theClassName,
Request theRequest) throws ClientException {
Object responseObject;
// Is it a Http Unit WebResponse ?
if (theClassName.equals("com.meterware.httpunit.WebResponse"))
{
responseObject = createHttpUnitWebResponse(this.connection);
// Is it a Html Unit WebResponse ?
}
else if (theClassName.equals(
"com.gargoylesoftware.htmlunit.WebResponse"))
{
responseObject = createHtmlUnitWebResponse(this.connection);
// Is it a Cactus WebResponse ?
}
else if (theClassName.equals("org.apache.cactus.WebResponse"))
{
responseObject = new WebResponse((WebRequest) theRequest,
this.connection);
// Is it an old HttpURLConnection (deprecated) ?
}
else if (theClassName.equals("java.net.HttpURLConnection"))
{
responseObject = this.connection;
}
else
{
// Else it is an error ...
throw new ClientException("Invalid parameter type [" + theClassName
+ "]");
}
return responseObject;
}
|