org.apache.http.impl.cookie
Class RFC2109SpecHC4

java.lang.Object
  extended by org.apache.http.impl.cookie.AbstractCookieSpecHC4
      extended by org.apache.http.impl.cookie.CookieSpecBaseHC4
          extended by org.apache.http.impl.cookie.RFC2109SpecHC4
All Implemented Interfaces:
org.apache.http.cookie.CookieSpec
Direct Known Subclasses:
RFC2965SpecHC4

@NotThreadSafe
public class RFC2109SpecHC4
extends CookieSpecBaseHC4

RFC 2109 compliant CookieSpec implementation. This is an older version of the official HTTP state management specification superseded by RFC 2965.

Since:
4.0
See Also:
RFC2965SpecHC4

Constructor Summary
RFC2109SpecHC4()
          Default constructor
RFC2109SpecHC4(java.lang.String[] datepatterns, boolean oneHeader)
          Default constructor
 
Method Summary
protected  void formatCookieAsVer(org.apache.http.util.CharArrayBuffer buffer, org.apache.http.cookie.Cookie cookie, int version)
          Return a string suitable for sending in a "Cookie" header as defined in RFC 2109 for backward compatibility with cookie version 0
 java.util.List<org.apache.http.Header> formatCookies(java.util.List<org.apache.http.cookie.Cookie> cookies)
           
protected  void formatParamAsVer(org.apache.http.util.CharArrayBuffer buffer, java.lang.String name, java.lang.String value, int version)
          Return a name/value string suitable for sending in a "Cookie" header as defined in RFC 2109 for backward compatibility with cookie version 0
 int getVersion()
           
 org.apache.http.Header getVersionHeader()
           
 java.util.List<org.apache.http.cookie.Cookie> parse(org.apache.http.Header header, org.apache.http.cookie.CookieOrigin origin)
           
 java.lang.String toString()
           
 void validate(org.apache.http.cookie.Cookie cookie, org.apache.http.cookie.CookieOrigin origin)
           
 
Methods inherited from class org.apache.http.impl.cookie.CookieSpecBaseHC4
getDefaultDomain, getDefaultPath, match, parse
 
Methods inherited from class org.apache.http.impl.cookie.AbstractCookieSpecHC4
findAttribHandler, getAttribHandler, getAttribHandlers, registerAttribHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RFC2109SpecHC4

public RFC2109SpecHC4(java.lang.String[] datepatterns,
                      boolean oneHeader)
Default constructor


RFC2109SpecHC4

public RFC2109SpecHC4()
Default constructor

Method Detail

parse

public java.util.List<org.apache.http.cookie.Cookie> parse(org.apache.http.Header header,
                                                           org.apache.http.cookie.CookieOrigin origin)
                                                    throws org.apache.http.cookie.MalformedCookieException
Throws:
org.apache.http.cookie.MalformedCookieException

validate

public void validate(org.apache.http.cookie.Cookie cookie,
                     org.apache.http.cookie.CookieOrigin origin)
              throws org.apache.http.cookie.MalformedCookieException
Specified by:
validate in interface org.apache.http.cookie.CookieSpec
Overrides:
validate in class CookieSpecBaseHC4
Throws:
org.apache.http.cookie.MalformedCookieException

formatCookies

public java.util.List<org.apache.http.Header> formatCookies(java.util.List<org.apache.http.cookie.Cookie> cookies)

formatParamAsVer

protected void formatParamAsVer(org.apache.http.util.CharArrayBuffer buffer,
                                java.lang.String name,
                                java.lang.String value,
                                int version)
Return a name/value string suitable for sending in a "Cookie" header as defined in RFC 2109 for backward compatibility with cookie version 0

Parameters:
buffer - The char array buffer to use for output
name - The cookie name
value - The cookie value
version - The cookie version

formatCookieAsVer

protected void formatCookieAsVer(org.apache.http.util.CharArrayBuffer buffer,
                                 org.apache.http.cookie.Cookie cookie,
                                 int version)
Return a string suitable for sending in a "Cookie" header as defined in RFC 2109 for backward compatibility with cookie version 0

Parameters:
buffer - The char array buffer to use for output
cookie - The Cookie to be formatted as string
version - The version to use.

getVersion

public int getVersion()

getVersionHeader

public org.apache.http.Header getVersionHeader()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object