private BrowserCompatSpec getCompat() { if (this.compat == null) { this.compat = new BrowserCompatSpec(this.datepatterns); } return compat; }
elems = header.getElements(); return parse(elems, origin);
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); } }
cookie.setPath(getDefaultPath(origin)); cookie.setDomain(getDefaultDomain(origin)); final String s = attrib.getName().toLowerCase(Locale.ROOT); cookie.setAttribute(s, attrib.getValue()); final CookieAttributeHandler handler = findAttribHandler(s); if (handler != null) { handler.parse(cookie, attrib.getValue()); return parse(helems, origin);
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); } }
/** Default constructor */ public BrowserCompatSpec(final String[] datepatterns) { super(); if (datepatterns != null) { this.datepatterns = datepatterns.clone(); } else { this.datepatterns = DATE_PATTERNS; } registerAttribHandler(ClientCookie.PATH_ATTR, new BasicPathHandler()); registerAttribHandler(ClientCookie.DOMAIN_ATTR, new BasicDomainHandler()); registerAttribHandler(ClientCookie.MAX_AGE_ATTR, new BasicMaxAgeHandler()); registerAttribHandler(ClientCookie.SECURE_ATTR, new BasicSecureHandler()); registerAttribHandler(ClientCookie.COMMENT_ATTR, new BasicCommentHandler()); registerAttribHandler(ClientCookie.EXPIRES_ATTR, new BasicExpiresHandler( this.datepatterns)); }
if (cookie.getVersion() > 0 && !isQuoteEnclosed(cookieValue)) { BasicHeaderValueFormatter.INSTANCE.formatHeaderElement( buffer,
cookie.setPath(getDefaultPath(origin)); cookie.setDomain(getDefaultDomain(origin)); final String s = attrib.getName().toLowerCase(Locale.ROOT); cookie.setAttribute(s, attrib.getValue()); final CookieAttributeHandler handler = findAttribHandler(s); if (handler != null) { handler.parse(cookie, attrib.getValue()); return parse(helems, origin);
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); } }
/** Default constructor */ public BrowserCompatSpec(final String[] datepatterns) { super(); if (datepatterns != null) { this.datepatterns = datepatterns.clone(); } else { this.datepatterns = DATE_PATTERNS; } registerAttribHandler(ClientCookie.PATH_ATTR, new BasicPathHandler()); registerAttribHandler(ClientCookie.DOMAIN_ATTR, new BasicDomainHandler()); registerAttribHandler(ClientCookie.MAX_AGE_ATTR, new BasicMaxAgeHandler()); registerAttribHandler(ClientCookie.SECURE_ATTR, new BasicSecureHandler()); registerAttribHandler(ClientCookie.COMMENT_ATTR, new BasicCommentHandler()); registerAttribHandler(ClientCookie.EXPIRES_ATTR, new BasicExpiresHandler( this.datepatterns)); }
if (cookie.getVersion() > 0 && !isQuoteEnclosed(cookieValue)) { BasicHeaderValueFormatter.INSTANCE.formatHeaderElement( buffer,
public CookieSpec newInstance(final HttpParams params) { if (params != null) { return new BrowserCompatSpec( (String []) params.getParameter(CookieSpecPNames.DATE_PATTERNS)); } else { return new BrowserCompatSpec(); } }
cookie.setPath(getDefaultPath(origin)); cookie.setDomain(getDefaultDomain(origin)); final String s = attrib.getName().toLowerCase(Locale.ROOT); cookie.setAttribute(s, attrib.getValue()); final CookieAttributeHandler handler = findAttribHandler(s); if (handler != null) { handler.parse(cookie, attrib.getValue()); return parse(helems, origin);
return getCompat().parse(helems, origin);
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); } }
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); } }
/** Default constructor */ public BrowserCompatSpec(final String[] datepatterns) { super(); if (datepatterns != null) { this.datepatterns = datepatterns.clone(); } else { this.datepatterns = DATE_PATTERNS; } registerAttribHandler(ClientCookie.PATH_ATTR, new BasicPathHandler()); registerAttribHandler(ClientCookie.DOMAIN_ATTR, new BasicDomainHandler()); registerAttribHandler(ClientCookie.MAX_AGE_ATTR, new BasicMaxAgeHandler()); registerAttribHandler(ClientCookie.SECURE_ATTR, new BasicSecureHandler()); registerAttribHandler(ClientCookie.COMMENT_ATTR, new BasicCommentHandler()); registerAttribHandler(ClientCookie.EXPIRES_ATTR, new BasicExpiresHandler( this.datepatterns)); }