com.meterware.httpunit
Class WebResponseUtil

java.lang.Object
  extended by com.meterware.httpunit.WebResponseUtil

public class WebResponseUtil
extends Object


Constructor Summary
WebResponseUtil()
           
 
Method Summary
static boolean replaceResponseContentType(com.meterware.httpunit.WebResponse webResponse, String contentType)
          This method takes a given webResponse and replaces the content type with the one supplied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebResponseUtil

public WebResponseUtil()
Method Detail

replaceResponseContentType

public static boolean replaceResponseContentType(com.meterware.httpunit.WebResponse webResponse,
                                                 String contentType)
This method takes a given webResponse and replaces the content type with the one supplied. This is useful for writing func tests that look at Excel or Word HTML which do not have the 'text/html' content type. HTTPUnit can only deal with 'text/html' content types.

This needs to be in teh com.meterware.httpunit package, since the replaceText method() only has package level access.

Parameters:
webResponse - The webResponse object returned by the request.
contentType - The new content type.
Returns:
True if the replace was successful. False if the webResponse could not be parsed.


Copyright © 2002-2014 Atlassian. All Rights Reserved.