# Class ClientProperties

java.lang.Object
com.meterware.httpunit.ClientProperties

public class ClientProperties extends Object
A class which represents the properties of a web client.

Author:
  Russell Gold

## Method Summary

Modifier and Type
Method
Description
`String`
`getApplicationCodeName()`
`String`
`getApplicationName()`
`String`
`getApplicationVersion()`
`int`
`getAvailableScreenWidth()`
`int`
`getAvailHeight()`
`static ClientProperties`
`getDefaultProperties()`
Returns the current defaults for newly created web clients.
`String`
`getOverrideContextType()`
Returns the context type (if any) to use instead of the one specified by the server.
`String`
`getPlatform()`
`String`
`getUserAgent()`
Returns the user agent identification.
`boolean`
`isAcceptCookies()`
Returns true if the client should accept and transmit cookies.
`boolean`
`isAcceptGzip()`
Returns true if the client will accept GZIP encoding of responses.
`boolean`
`isAutoRedirect()`
Returns true if the client should automatically follow page redirect requests (status 3xx).
`boolean`
`isAutoRefresh()`
Returns true if the client should automatically follow page refresh requests.
`boolean`
`isIframeSupported()`
`boolean`
`isSendReferer()`
`void`
`setAcceptCookies(boolean acceptCookies)`
Specifies whether the client should accept and send cookies.
`void`
`setAcceptGzip(boolean acceptGzip)`
Specifies whether the client will accept GZIP encoded responses.
`void`
`setApplicationCodeName(String applicationCodeName)`
`void`
`setApplicationID(String applicationName, String applicationCodeName, String applicationVersion)`
Specifies the ID information for a client.
`void`
`setApplicationName(String applicationName)`
`void`
`setApplicationVersion(String applicationVersion)`
`void`
`setAutoRedirect(boolean autoRedirect)`
Determines whether the client should automatically follow page redirect requests (status 3xx).
`void`
`setAutoRefresh(boolean autoRefresh)`
Specifies whether the client should automatically follow page refresh requests.
`void`
`setAvailableScreenSize(int width, int height)`
A shortcut for setting both availableScreenWidth and availableScreenHeight at one time.
`void`
`setAvailableScreenWidth(int availWidth)`
`void`
`setAvailHeight(int availHeight)`
`void`
`setDnsListener(DNSListener dnsListener)`
Specifies a listener for DNS requests from the client.
`void`
`setIframeSupported(boolean iframeSupported)`
`void`
`setOverrideContextType(String overrideContextType)`
All responses to this client will use the specified content type rather than the one specified by the server.
`void`
`setPlatform(String platform)`
`void`
`setSendReferer(boolean referer)`
set whether Referer information should be stripped
`void`
`setUserAgent(String userAgent)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### getDefaultProperties

public static ClientProperties getDefaultProperties()
Returns the current defaults for newly created web clients.

### setApplicationID

public void setApplicationID(String applicationName, String applicationCodeName, String applicationVersion)
Specifies the ID information for a client.

### getApplicationCodeName

public String getApplicationCodeName()

### setApplicationCodeName

public void setApplicationCodeName(String applicationCodeName)

### getApplicationName

public String getApplicationName()

### setApplicationName

public void setApplicationName(String applicationName)

### getApplicationVersion

public String getApplicationVersion()

### setApplicationVersion

public void setApplicationVersion(String applicationVersion)

### getUserAgent

public String getUserAgent()
Returns the user agent identification. Unless this has been set explicitly, it will default to the application code name followed by a slash and the application version.

### setUserAgent

public void setUserAgent(String userAgent)

### getPlatform

public String getPlatform()

### setPlatform

public void setPlatform(String platform)

### setAvailableScreenSize

public void setAvailableScreenSize(int width, int height)
A shortcut for setting both availableScreenWidth and availableScreenHeight at one time.

### getAvailableScreenWidth

public int getAvailableScreenWidth()

### setAvailableScreenWidth

public void setAvailableScreenWidth(int availWidth)

### getAvailHeight

public int getAvailHeight()

### setAvailHeight

public void setAvailHeight(int availHeight)

### isAcceptCookies

public boolean isAcceptCookies()
Returns true if the client should accept and transmit cookies. The default is to accept them.

### setAcceptCookies

public void setAcceptCookies(boolean acceptCookies)
Specifies whether the client should accept and send cookies.

### isAcceptGzip

public boolean isAcceptGzip()
Returns true if the client will accept GZIP encoding of responses. The default is to accept GZIP encoding.

### setAcceptGzip

public void setAcceptGzip(boolean acceptGzip)
Specifies whether the client will accept GZIP encoded responses. The default is true.

### isAutoRedirect

public boolean isAutoRedirect()
Returns true if the client should automatically follow page redirect requests (status 3xx). By default, this is true.

### setAutoRedirect

public void setAutoRedirect(boolean autoRedirect)
Determines whether the client should automatically follow page redirect requests (status 3xx). By default, this is true in order to simulate normal browser operation.

### isAutoRefresh

public boolean isAutoRefresh()
Returns true if the client should automatically follow page refresh requests. By default, this is false, so that programs can verify the redirect page presented to users before the browser switches to the new page.

### setAutoRefresh

public void setAutoRefresh(boolean autoRefresh)
Specifies whether the client should automatically follow page refresh requests. By default, this is false, so that programs can verify the redirect page presented to users before the browser switches to the new page. Setting this to true can cause an infinite loop on pages that refresh themselves.

### isIframeSupported

public boolean isIframeSupported()

### setIframeSupported

public void setIframeSupported(boolean iframeSupported)

### getOverrideContextType

public String getOverrideContextType()
Returns the context type (if any) to use instead of the one specified by the server. Defaults to null.

Returns:
  the overriding context type, or null if none is specified.

### setOverrideContextType

public void setOverrideContextType(String overrideContextType)
All responses to this client will use the specified content type rather than the one specified by the server. Setting this to "text/html" will force all reponses to be interpreted as HTML.

Parameters:
  `overrideContextType` - the new override to apply to context types.

### setDnsListener

public void setDnsListener(DNSListener dnsListener)
Specifies a listener for DNS requests from the client.

Parameters:
  `dnsListener` - the new listener.

### isSendReferer

public boolean isSendReferer()

Returns:
  the whether Referer information should be stripped from the header

### setSendReferer

public void setSendReferer(boolean referer)
set whether Referer information should be stripped

Parameters:
  `referer` - the _sendReferer to set