# UserAgent (Crawler-commons 0.7 API)
Date: 2016-11-21

crawlercommons.fetcher.http

## Class UserAgent

- java.lang.Object
- - crawlercommons.fetcher.http.UserAgent

All Implemented Interfaces:
  Serializable

Deprecated.
As of release 0.6. We recommend directly using Apache HttpClient, async-http-client, or any other robust, industrial-strength HTTP clients.

    @Deprecated
    public class UserAgent
    extends Object
    implements Serializable

User Agent enables us to describe characteristics of any Crawler Commons agent. There are a number of constructor options to describe the following:

1. `_agentName`: Primary agent name.
2. `_emailAddress`: The agent owners email address.
3. `_webAddress`: A web site/address representing the agent owner.
4. `_browserVersion`: Broswer version used for compatibility.
5. `_crawlerVersion`: Version of the user agents personal crawler. If this is not set, it defaults to the crawler commons maven artifact version.

See Also:
  Serialized Form

### Field Summary

Fields
`static String` `DEFAULT_BROWSER_VERSION` Deprecated.
`static String` `DEFAULT_CRAWLER_VERSION` Deprecated.

### Constructor Summary

Constructors
Constructor and Description
`UserAgent(String agentName, String emailAddress, String webAddress)` Deprecated. Set user agent characteristics
`UserAgent(String agentName, String emailAddress, String webAddress, String browserVersion)` Deprecated. Set user agent characteristics
`UserAgent(String agentName, String emailAddress, String webAddress, String browserVersion, String crawlerVersion)` Deprecated. Set user agent characteristics

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`String` `getAgentName()` Deprecated. Obtain the just the user agent name
`String` `getUserAgentString()` Deprecated. Obtain a String representing the user agent characteristics.

### Methods inherited from class java.lang.Object

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

### Field Detail

#### DEFAULT_BROWSER_VERSION

    public static final String DEFAULT_BROWSER_VERSION

Deprecated.

See Also:
  Constant Field Values

#### DEFAULT_CRAWLER_VERSION

    public static final String DEFAULT_CRAWLER_VERSION

Deprecated.

### Constructor Detail

#### UserAgent

    public UserAgent(String agentName,
                     String emailAddress,
                     String webAddress)

Deprecated.
Set user agent characteristics

Parameters:
  `agentName` - an agent name string to associate with the crawler
  `emailAddress` - an agent email address string to associate with the crawler
  `webAddress` - a Web address string to associate with the crawler

#### UserAgent

    public UserAgent(String agentName,
                     String emailAddress,
                     String webAddress,
                     String browserVersion)

Deprecated.
Set user agent characteristics

Parameters:
  `agentName` - an agent name string to associate with the crawler
  `emailAddress` - an agent email address string to associate with the crawler
  `webAddress` - a Web address string to associate with the crawler
  `browserVersion` - a browser version to mimic

#### UserAgent

    public UserAgent(String agentName,
                     String emailAddress,
                     String webAddress,
                     String browserVersion,
                     String crawlerVersion)

Deprecated.
Set user agent characteristics

Parameters:
  `agentName` - an agent name string to associate with the crawler
  `emailAddress` - an agent email address string to associate with the crawler
  `webAddress` - a Web address string to associate with the crawler
  `browserVersion` - a browser version to mimic
  `crawlerVersion` - the version of your crawler/crawl agent

### Method Detail

#### getAgentName

    public String getAgentName()

Deprecated.
Obtain the just the user agent name

Returns:
  User Agent name (String)

#### getUserAgentString

    public String getUserAgentString()

Deprecated.
Obtain a String representing the user agent characteristics.

Returns:
  User Agent String