/** * Return a string suitable for sending in a <tt>"Cookie"</tt> header as * defined in RFC 2109 * @param cookie a {@link Cookie} to be formatted as string * @return a string suitable for sending in a <tt>"Cookie"</tt> header. */ public String formatCookie(Cookie cookie) { LOG.trace("enter RFC2109Spec.formatCookie(Cookie)"); if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } int version = cookie.getVersion(); StringBuffer buffer = new StringBuffer(); formatParam(buffer, new NameValuePair("$Version", Integer.toString(version)), version); buffer.append("; "); formatCookieAsVer(buffer, cookie, version); return buffer.toString(); }
/** * Create a RFC 2109 compliant <tt>"Cookie"</tt> header value containing all * {@link Cookie}s in <i>cookies</i> suitable for sending in a <tt>"Cookie" * </tt> header * @param cookies an array of {@link Cookie}s to be formatted * @return a string suitable for sending in a Cookie header. */ public String formatCookies(Cookie[] cookies) { LOG.trace("enter RFC2109Spec.formatCookieHeader(Cookie[])"); int version = Integer.MAX_VALUE; // Pick the lowerest common denominator for (int i = 0; i < cookies.length; i++) { Cookie cookie = cookies[i]; if (cookie.getVersion() < version) { version = cookie.getVersion(); } } final StringBuffer buffer = new StringBuffer(); formatParam(buffer, new NameValuePair("$Version", Integer.toString(version)), version); for (int i = 0; i < cookies.length; i++) { buffer.append("; "); formatCookieAsVer(buffer, cookies[i], version); } return buffer.toString(); }
/** * Return a string suitable for sending in a <tt>"Cookie"</tt> header as * defined in RFC 2109 * @param cookie a {@link Cookie} to be formatted as string * @return a string suitable for sending in a <tt>"Cookie"</tt> header. */ public String formatCookie(Cookie cookie) { LOG.trace("enter RFC2109Spec.formatCookie(Cookie)"); if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } int version = cookie.getVersion(); StringBuffer buffer = new StringBuffer(); formatParam(buffer, new NameValuePair("$Version", Integer.toString(version)), version); buffer.append("; "); formatCookieAsVer(buffer, cookie, version); return buffer.toString(); }
/** * Return a string suitable for sending in a <tt>"Cookie"</tt> header as * defined in RFC 2109 * @param cookie a {@link Cookie} to be formatted as string * @return a string suitable for sending in a <tt>"Cookie"</tt> header. */ public String formatCookie(Cookie cookie) { LOG.trace("enter RFC2109Spec.formatCookie(Cookie)"); if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } int version = cookie.getVersion(); StringBuffer buffer = new StringBuffer(); formatParam(buffer, new NameValuePair("$Version", Integer.toString(version)), version); buffer.append("; "); formatCookieAsVer(buffer, cookie, version); return buffer.toString(); }
/** * Return a string suitable for sending in a <tt>"Cookie"</tt> header as * defined in RFC 2109 * @param cookie a {@link Cookie} to be formatted as string * @return a string suitable for sending in a <tt>"Cookie"</tt> header. */ public String formatCookie(Cookie cookie) { LOG.trace("enter RFC2109Spec.formatCookie(Cookie)"); if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } int version = cookie.getVersion(); StringBuffer buffer = new StringBuffer(); formatParam(buffer, new NameValuePair("$Version", Integer.toString(version)), version); buffer.append("; "); formatCookieAsVer(buffer, cookie, version); return buffer.toString(); }
/** * Return a string suitable for sending in a <tt>"Cookie"</tt> header as * defined in RFC 2109 * @param cookie a {@link Cookie} to be formatted as string * @return a string suitable for sending in a <tt>"Cookie"</tt> header. */ public String formatCookie(Cookie cookie) { LOG.trace("enter RFC2109Spec.formatCookie(Cookie)"); if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } int version = cookie.getVersion(); StringBuffer buffer = new StringBuffer(); formatParam(buffer, new NameValuePair("$Version", Integer.toString(version)), version); buffer.append("; "); formatCookieAsVer(buffer, cookie, version); return buffer.toString(); }
/** * Create a RFC 2109 compliant <tt>"Cookie"</tt> header value containing all * {@link Cookie}s in <i>cookies</i> suitable for sending in a <tt>"Cookie" * </tt> header * @param cookies an array of {@link Cookie}s to be formatted * @return a string suitable for sending in a Cookie header. */ public String formatCookies(Cookie[] cookies) { LOG.trace("enter RFC2109Spec.formatCookieHeader(Cookie[])"); int version = Integer.MAX_VALUE; // Pick the lowerest common denominator for (int i = 0; i < cookies.length; i++) { Cookie cookie = cookies[i]; if (cookie.getVersion() < version) { version = cookie.getVersion(); } } final StringBuffer buffer = new StringBuffer(); formatParam(buffer, new NameValuePair("$Version", Integer.toString(version)), version); for (int i = 0; i < cookies.length; i++) { buffer.append("; "); formatCookieAsVer(buffer, cookies[i], version); } return buffer.toString(); }
/** * Create a RFC 2109 compliant <tt>"Cookie"</tt> header value containing all * {@link Cookie}s in <i>cookies</i> suitable for sending in a <tt>"Cookie" * </tt> header * @param cookies an array of {@link Cookie}s to be formatted * @return a string suitable for sending in a Cookie header. */ public String formatCookies(Cookie[] cookies) { LOG.trace("enter RFC2109Spec.formatCookieHeader(Cookie[])"); int version = Integer.MAX_VALUE; // Pick the lowerest common denominator for (int i = 0; i < cookies.length; i++) { Cookie cookie = cookies[i]; if (cookie.getVersion() < version) { version = cookie.getVersion(); } } final StringBuffer buffer = new StringBuffer(); formatParam(buffer, new NameValuePair("$Version", Integer.toString(version)), version); for (int i = 0; i < cookies.length; i++) { buffer.append("; "); formatCookieAsVer(buffer, cookies[i], version); } return buffer.toString(); }
/** * Create a RFC 2109 compliant <tt>"Cookie"</tt> header value containing all * {@link Cookie}s in <i>cookies</i> suitable for sending in a <tt>"Cookie" * </tt> header * @param cookies an array of {@link Cookie}s to be formatted * @return a string suitable for sending in a Cookie header. */ public String formatCookies(Cookie[] cookies) { LOG.trace("enter RFC2109Spec.formatCookieHeader(Cookie[])"); int version = Integer.MAX_VALUE; // Pick the lowerest common denominator for (int i = 0; i < cookies.length; i++) { Cookie cookie = cookies[i]; if (cookie.getVersion() < version) { version = cookie.getVersion(); } } final StringBuffer buffer = new StringBuffer(); formatParam(buffer, new NameValuePair("$Version", Integer.toString(version)), version); for (int i = 0; i < cookies.length; i++) { buffer.append("; "); formatCookieAsVer(buffer, cookies[i], version); } return buffer.toString(); }
/** * Create a RFC 2109 compliant <tt>"Cookie"</tt> header value containing all * {@link Cookie}s in <i>cookies</i> suitable for sending in a <tt>"Cookie" * </tt> header * @param cookies an array of {@link Cookie}s to be formatted * @return a string suitable for sending in a Cookie header. */ public String formatCookies(Cookie[] cookies) { LOG.trace("enter RFC2109Spec.formatCookieHeader(Cookie[])"); int version = Integer.MAX_VALUE; // Pick the lowerest common denominator for (int i = 0; i < cookies.length; i++) { Cookie cookie = cookies[i]; if (cookie.getVersion() < version) { version = cookie.getVersion(); } } final StringBuffer buffer = new StringBuffer(); formatParam(buffer, new NameValuePair("$Version", Integer.toString(version)), version); for (int i = 0; i < cookies.length; i++) { buffer.append("; "); formatCookieAsVer(buffer, cookies[i], version); } return buffer.toString(); }