org.apache.tomcat.util.http
public final class Cookies extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
ALLOW_EQUALS_IN_VALUE
If true, cookie values are allowed to contain an equals character without
being quoted.
|
static int |
INITIAL_SIZE |
protected static boolean[] |
separators |
static char[] |
SEPARATORS |
Constructor and Description |
---|
Cookies()
Construct a new uninitialized cookie collection.
|
Cookies(MimeHeaders headers)
Construct a new cookie collection, that will extract
the information from headers.
|
Modifier and Type | Method and Description |
---|---|
ServerCookie |
addCookie()
Register a new, unitialized cookie.
|
static boolean |
equals(java.lang.String s,
byte[] b,
int start,
int end) |
ServerCookie |
getCookie(int idx) |
int |
getCookieCount() |
static 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.
|
static int |
getTokenEndPosition(byte[] bytes,
int off,
int end)
Deprecated.
- Use private method
getTokenEndPosition(byte[], int, int, boolean) instead |
static boolean |
isSeparator(byte c)
Returns true if the byte is a separator character as
defined in RFC2619.
|
static boolean |
isWhiteSpace(byte c)
Returns true if the byte is a whitespace character as
defined in RFC2619
JVK
|
void |
log(java.lang.String s) |
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
|
void |
processCookies(MimeHeaders headers)
Add all Cookie found in the headers of a request.
|
void |
recycle()
Recycle.
|
void |
setHeaders(MimeHeaders headers)
Set the headers from which cookies will be pulled.
|
java.lang.String |
toString()
EXPENSIVE!!!
|
public static final int INITIAL_SIZE
public static final boolean ALLOW_EQUALS_IN_VALUE
public static final char[] SEPARATORS
protected static final boolean[] separators
public Cookies(MimeHeaders headers)
headers
- Cookies are lazy-evaluated and will extract the
information from the provided headers.public Cookies()
setHeaders(org.apache.tomcat.util.http.MimeHeaders)
to initialize.public void setHeaders(MimeHeaders headers)
headers
- Cookies are lazy-evaluated and will extract the
information from the provided headers.public void recycle()
public java.lang.String toString()
toString
in class java.lang.Object
public ServerCookie getCookie(int idx)
public int getCookieCount()
public ServerCookie addCookie()
public void processCookies(MimeHeaders headers)
public static boolean equals(java.lang.String s, byte[] b, int start, int end)
public void log(java.lang.String s)
public static final boolean isSeparator(byte c)
public static final boolean isWhiteSpace(byte c)
public final void processCookieHeader(byte[] bytes, int off, int len)
public static final int getTokenEndPosition(byte[] bytes, int off, int end)
getTokenEndPosition(byte[], int, int, boolean)
insteadpublic static final int getQuotedValueEndPosition(byte[] bytes, int off, int end)
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.