org.encog.util.http

## Class CookieUtility

- java.lang.Object
- - org.encog.util.http.CookieUtility

-     public class CookieUtility
      extends Object

  This class allows URLConnection objects to process cookies. The loadCookies method grabs the Set-Cookie headers and loads the cookies into the map. The saveCookies method writes out the cookie map to the a URLConnection object as Cookie headers.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CookieUtility()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map<String,String>` | `getMap()` Allows access to the name/value pair list of cookies.
    `void` | `loadCookies(URLConnection http)` Load any cookies from the specified URLConnection object.
    `void` | `saveCookies(URLConnection http)` Once you have loaded cookies with loadCookies, you can call saveCookies to copy these cookies to a new HTTP request.

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

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

- - ### Constructor Detail

    - #### CookieUtility

          public CookieUtility()

  - ### Method Detail

    - #### getMap

          public Map<String,String> getMap()

      Allows access to the name/value pair list of cookies.
      Returns:
        the map

    - #### loadCookies

          public void loadCookies(URLConnection http)

      Load any cookies from the specified URLConnection object. Cookies will be located by their Set-Cookie headers. Any cookies that are found can be moved to a new URLConnection class by calling saveCookies.
      Parameters:
        `http` - The URLConnection object to load the cookies from.

    - #### saveCookies

          public void saveCookies(URLConnection http)

      Once you have loaded cookies with loadCookies, you can call saveCookies to copy these cookies to a new HTTP request. This allows you to easily support cookies.
      Parameters:
        `http` - The URLConnection object to add cookies to.

Copyright © 2014. All Rights Reserved.