Home » apache-tomcat-6.0.26-src » org.apache » tomcat » util » http » [javadoc | source]
org.apache.tomcat.util.http
public final class: Cookies [javadoc | source]
java.lang.Object
   org.apache.tomcat.util.http.Cookies
A collection of cookies - reusable and tuned for server side performance. Based on RFC2965 ( and 2109 ) This class is not synchronized.
Field Summary
public static final  int INITIAL_SIZE     
 ServerCookie[] scookies     
 int cookieCount     
 boolean unprocessed     
 MimeHeaders headers     
public static final  boolean ALLOW_EQUALS_IN_VALUE    If true, cookie values are allowed to contain an equals character without being quoted. 
public static final  char[] SEPARATORS     
protected static final  boolean[] separators     
static final  int dbg     
Constructor:
 public Cookies() 
 public Cookies(MimeHeaders headers) 
    Construct a new cookie collection, that will extract the information from headers.
    Parameters:
    headers - Cookies are lazy-evaluated and will extract the information from the provided headers.
Method from org.apache.tomcat.util.http.Cookies Summary:
addCookie,   equals,   getCookie,   getCookieCount,   getQuotedValueEndPosition,   getTokenEndPosition,   isSeparator,   isWhiteSpace,   log,   processCookieHeader,   processCookies,   recycle,   setHeaders,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tomcat.util.http.Cookies Detail:
 public ServerCookie addCookie() 
    Register a new, unitialized cookie. Cookies are recycled, and most of the time an existing ServerCookie object is returned. The caller can set the name/value and attributes for the cookie
 public static boolean equals(String s,
    byte[] b,
    int start,
    int end) 
 public ServerCookie getCookie(int idx) 
 public int getCookieCount() 
 public static final int getQuotedValueEndPosition(byte[] bytes,
    int off,
    int end) 
    Given a starting position after an initial quote chracter, this gets the position of the end quote. This escapes anything after a '\' char JVK RFC 2616
 public static final int getTokenEndPosition(byte[] bytes,
    int off,
    int end) 
Deprecated! - - Use private method #getTokenEndPosition(byte[], int, int, boolean) instead

 public static final boolean isSeparator(byte c) 
    Returns true if the byte is a separator character as defined in RFC2619. Since this is called often, this function should be organized with the most probable outcomes first. JVK
 public static final boolean isWhiteSpace(byte c) 
    Returns true if the byte is a whitespace character as defined in RFC2619 JVK
 public  void log(String s) 
 public final  void processCookieHeader(byte[] bytes,
    int off,
    int len) 
    Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVK
 public  void processCookies(MimeHeaders headers) 
    Add all Cookie found in the headers of a request.
 public  void recycle() 
    Recycle.
 public  void setHeaders(MimeHeaders headers) 
    Set the headers from which cookies will be pulled. This has the side effect of recycling the object.
 public String toString() 
    EXPENSIVE!!! only for debugging.