private RFC2965Spec getStrict() { if (this.strict == null) { this.strict = new RFC2965Spec(this.datepatterns, this.oneHeader); } return strict; }
origin = adjustEffectiveHost(origin); cookie = createCookie2(name, value, origin); } else { cookie = createCookie(name, value, origin); CookieAttributeHandler handler = findAttribHandler(s); if (handler != null) { handler.parse(cookie, attrib.getValue());
public List<Header> formatCookies(final List<Cookie> cookies) { if (cookies == null) { throw new IllegalArgumentException("List of cookie may not be null"); } int version = Integer.MAX_VALUE; for (Cookie cookie: cookies) { if (cookie.getVersion() < version) { version = cookie.getVersion(); } } if (version > 0) { return getStrict().formatCookies(cookies); } else { return getCompat().formatCookies(cookies); } }
private BasicClientCookie createCookie( final String name, final String value, final CookieOrigin origin) { BasicClientCookie cookie = new BasicClientCookie(name, value); cookie.setPath(getDefaultPath(origin)); cookie.setDomain(getDefaultDomain(origin)); return cookie; }
cookie.setPath(getDefaultPath(origin)); cookie.setDomain(getDefaultDomain(origin)); cookie.setPorts(new int [] { origin.getPort() }); final CookieAttributeHandler handler = findAttribHandler(s); if (handler != null) { handler.parse(cookie, attrib.getValue());
public int getVersion() { return getStrict().getVersion(); }
public boolean match(final Cookie cookie, final CookieOrigin origin) { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (origin == null) { throw new IllegalArgumentException("Cookie origin may not be null"); } if (cookie.getVersion() > 0) { return getStrict().match(cookie, origin); } else { return getCompat().match(cookie, origin); } }
public void validate( final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (origin == null) { throw new IllegalArgumentException("Cookie origin may not be null"); } if (cookie.getVersion() > 0) { getStrict().validate(cookie, origin); } else { getCompat().validate(cookie, origin); } }
return getStrict().parse(helems, origin); } else if (netscape) {
@Override public void validate(final Cookie cookie, CookieOrigin origin) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (origin == null) { throw new IllegalArgumentException("Cookie origin may not be null"); } origin = adjustEffectiveHost(origin); super.validate(cookie, origin); }
@Override protected List<Cookie> parse( final HeaderElement[] elems, final CookieOrigin origin) throws MalformedCookieException { return createCookies(elems, adjustEffectiveHost(origin)); }
cookie.setPath(getDefaultPath(origin)); cookie.setDomain(getDefaultDomain(origin)); cookie.setPorts(new int [] { origin.getPort() }); final CookieAttributeHandler handler = findAttribHandler(s); if (handler != null) { handler.parse(cookie, attrib.getValue());
private BasicClientCookie createCookie2( final String name, final String value, final CookieOrigin origin) { BasicClientCookie2 cookie = new BasicClientCookie2(name, value); cookie.setPath(getDefaultPath(origin)); cookie.setDomain(getDefaultDomain(origin)); cookie.setPorts(new int [] { origin.getPort() }); return cookie; }
@Override public Header getVersionHeader() { CharArrayBuffer buffer = new CharArrayBuffer(40); buffer.append(SM.COOKIE2); buffer.append(": "); buffer.append("$Version="); buffer.append(Integer.toString(getVersion())); return new BufferedHeader(buffer); }
public boolean match(final Cookie cookie, final CookieOrigin origin) { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (origin == null) { throw new IllegalArgumentException("Cookie origin may not be null"); } if (cookie.getVersion() > 0) { return getStrict().match(cookie, origin); } else { return getCompat().match(cookie, origin); } }
public void validate( final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (origin == null) { throw new IllegalArgumentException("Cookie origin may not be null"); } if (cookie.getVersion() > 0) { getStrict().validate(cookie, origin); } else { getCompat().validate(cookie, origin); } }
return getStrict().parse(helems, origin); } else if (netscape) {
@Override public boolean match(final Cookie cookie, CookieOrigin origin) { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (origin == null) { throw new IllegalArgumentException("Cookie origin may not be null"); } origin = adjustEffectiveHost(origin); return super.match(cookie, origin); }
@Override protected List<Cookie> parse( final HeaderElement[] elems, final CookieOrigin origin) throws MalformedCookieException { return createCookies(elems, adjustEffectiveHost(origin)); }
cookie.setPath(getDefaultPath(origin)); cookie.setDomain(getDefaultDomain(origin)); cookie.setPorts(new int [] { origin.getPort() }); final CookieAttributeHandler handler = findAttribHandler(s); if (handler != null) { handler.parse(cookie, attrib.getValue());