org.apache.commons.feedparser.network
Class URLCookieManager

java.lang.Object
  extended by org.apache.commons.feedparser.network.URLCookieManager

public class URLCookieManager
extends Object

By default java.net.URL does NOT handle cookies. This is a simple extension that allows us to persist cookies in the VM during runtime. FIXME: How can we make sure to delete older sites...?! no need for this to grow to infinite size.

Author:
Kevin A. Burton

Constructor Summary
URLCookieManager()
           
 
Method Summary
static Hashtable getCookies(String site)
          Get the cookies for a site.
static String getCookiesHeader(Hashtable cookies)
          Parse a given Cookie header into a hashtable.
static String getSite(ResourceRequest request)
           
static void init(ResourceRequest request)
          Add cookies to this request and perform any other init.
static void main(String[] args)
           
static Hashtable parseCookieHeader(String header)
          Parse a given Cookie header into a hashtable.
static void save(ResourceRequest request)
          Save the cookies FROM this request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLCookieManager

public URLCookieManager()
Method Detail

getCookies

public static Hashtable getCookies(String site)
Get the cookies for a site. When none are available return null.


init

public static void init(ResourceRequest request)
Add cookies to this request and perform any other init.


getSite

public static String getSite(ResourceRequest request)

save

public static void save(ResourceRequest request)
Save the cookies FROM this request.


getCookiesHeader

public static String getCookiesHeader(Hashtable cookies)
Parse a given Cookie header into a hashtable.


parseCookieHeader

public static Hashtable parseCookieHeader(String header)
Parse a given Cookie header into a hashtable.


main

public static void main(String[] args)


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.