@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (cookie.getVersion() < 0) { throw new MalformedCookieException("Cookie version may not be negative"); } }
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); } }
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); } }
/** * Don't log the cookie's value; that's potentially sensitive information. */ private String cookieToString(Cookie cookie) { return cookie.getClass().getSimpleName() + "[version=" + cookie.getVersion() + ",name=" + cookie.getName() + ",domain=" + cookie.getDomain() + ",path=" + cookie.getPath() + ",expiry=" + cookie.getExpiryDate() + "]"; } // END android-added
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); } }
private List<Header> doFormatManyHeaders(final List<Cookie> cookies) { List<Header> headers = new ArrayList<Header>(cookies.size()); for (Cookie cookie : cookies) { int version = cookie.getVersion(); CharArrayBuffer buffer = new CharArrayBuffer(40); buffer.append("Cookie: "); buffer.append("$Version="); buffer.append(Integer.toString(version)); buffer.append("; "); formatCookieAsVer(buffer, cookie, version); headers.add(new BufferedHeader(buffer)); } return headers; }
private List<Header> doFormatOneHeader(final List<Cookie> cookies) { int version = Integer.MAX_VALUE; // Pick the lowest common denominator for (Cookie cookie : cookies) { if (cookie.getVersion() < version) { version = cookie.getVersion(); } } CharArrayBuffer buffer = new CharArrayBuffer(40 * cookies.size()); buffer.append(SM.COOKIE); buffer.append(": "); buffer.append("$Version="); buffer.append(Integer.toString(version)); for (Cookie cooky : cookies) { buffer.append("; "); Cookie cookie = cooky; formatCookieAsVer(buffer, cookie, version); } List<Header> headers = new ArrayList<Header>(1); headers.add(new BufferedHeader(buffer)); return headers; }
boolean needVersionHeader = false; for (Cookie cookie : matchedCookies) { if (ver != cookie.getVersion()) { needVersionHeader = true;
@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (cookie.getVersion() < 0) { throw new MalformedCookieException("Cookie version may not be negative"); } }
@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (cookie.getVersion() < 0) { throw new MalformedCookieException("Cookie version may not be negative"); } }
@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (cookie.getVersion() < 0) { throw new MalformedCookieException("Cookie version may not be negative"); } }
@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (cookie.getVersion() < 0) { throw new MalformedCookieException("Cookie version may not be negative"); } }
@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (cookie.getVersion() < 0) { throw new CookieRestrictionViolationException("Cookie version may not be negative"); } }
@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (cookie.getVersion() < 0) { throw new CookieRestrictionViolationException("Cookie version may not be negative"); } }
@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (cookie.getVersion() < 0) { throw new CookieRestrictionViolationException("Cookie version may not be negative"); } }
@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (cookie.getVersion() < 0) { throw new CookieRestrictionViolationException("Cookie version may not be negative"); } }
@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (cookie.getVersion() < 0) { throw new CookieRestrictionViolationException("Cookie version may not be negative"); } }
@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (cookie.getVersion() < 0) { throw new CookieRestrictionViolationException("Cookie version may not be negative"); } }
@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { Args.notNull(cookie, "Cookie"); if (cookie.getVersion() < 0) { throw new CookieRestrictionViolationException("Cookie version may not be negative"); } }
/** * Don't log the cookie's value; that's potentially sensitive information. */ private String cookieToString(Cookie cookie) { return cookie.getClass().getSimpleName() + "[version=" + cookie.getVersion() + ",name=" + cookie.getName() + ",domain=" + cookie.getDomain() + ",path=" + cookie.getPath() + ",expiry=" + cookie.getExpiryDate() + "]"; } // END android-added