wjhk.jupload2.upload
Class CookieJar
java.lang.Object
wjhk.jupload2.upload.CookieJar
public class CookieJar
- extends Object
This class implements a container for multiple cookies in a single domain.
- Author:
- felfert
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pNvPair
static final Pattern pNvPair
CookieJar
public CookieJar()
setDomain
public void setDomain(String domain)
- Sets the domain for this cookie jar. If set, only cookies matching the
specified domain are handled.
- Parameters:
domain - The domain of this instance
buildCookieHeader
public String buildCookieHeader(URL url)
- Builds a RFC 2109 compliant client cookie header for the specified URL.
- Parameters:
url - The URL for which the cookie header is to be used.
- Returns:
- A client cookie header (including the "Cookie: " prefix) or null
if no cookies are to be set.
parseCookieHeader
public void parseCookieHeader(String s)
- Parses a "Set-Cookie" header and creates/updates/deletes cookies
according to the parsed values. Parsing is done according to the
specification in RFC 2109
- Parameters:
s - The plain value of the "Set-Cookie" HTTP header. e.g.: without
the "Set-Cookie: " prefix.