@Override public String toString(Cookie cookie) { throwIllegalArgumentExceptionIfNull(cookie, LocalizationMessages.COOKIE_IS_NULL()); StringBuilder b = new StringBuilder(); b.append("$Version=").append(cookie.getVersion()).append(';'); b.append(cookie.getName()).append('='); StringBuilderUtils.appendQuotedIfWhitespace(b, cookie.getValue()); if (cookie.getDomain() != null) { b.append(";$Domain="); StringBuilderUtils.appendQuotedIfWhitespace(b, cookie.getDomain()); } if (cookie.getPath() != null) { b.append(";$Path="); StringBuilderUtils.appendQuotedIfWhitespace(b, cookie.getPath()); } return b.toString(); }
@Override public String toString(Cookie cookie) { throwIllegalArgumentExceptionIfNull(cookie, LocalizationMessages.COOKIE_IS_NULL()); StringBuilder b = new StringBuilder(); b.append("$Version=").append(cookie.getVersion()).append(';'); b.append(cookie.getName()).append('='); StringBuilderUtils.appendQuotedIfWhitespace(b, cookie.getValue()); if (cookie.getDomain() != null) { b.append(";$Domain="); StringBuilderUtils.appendQuotedIfWhitespace(b, cookie.getDomain()); } if (cookie.getPath() != null) { b.append(";$Path="); StringBuilderUtils.appendQuotedIfWhitespace(b, cookie.getPath()); } return b.toString(); }
public String toString(Cookie value) { StringBuffer buf = new StringBuffer(); ServerCookie.appendCookieValue(buf, 0, value.getName(), value.getValue(), value.getPath(), value.getDomain(), null, -1, false); return buf.toString(); } }
public void cookie(Cookie cookie) { if (!(Cookie.class.equals(cookie.getClass()))) { cookie = new Cookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain(), cookie.getVersion()); } headers.add(HttpHeaders.COOKIE, cookie); }
@Override public Invocation.Builder cookie(Cookie cookie) { if (!(Cookie.class.equals(cookie.getClass()))) { cookie = new Cookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain(), cookie.getVersion()); } getHeaders().cookie(cookie); return this; }
public String toString(Cookie value) { StringBuffer buf = new StringBuffer(); ServerCookie.appendCookieValue(buf, 0, value.getName(), value.getValue(), value.getPath(), value.getDomain(), null, -1, false); return buf.toString(); } }
public String toString(Cookie value) { StringBuffer buf = new StringBuffer(); ServerCookie.appendCookieValue(buf, 0, value.getName(), value.getValue(), value.getPath(), value.getDomain(), null, -1, false); return buf.toString(); } }
public void cookie(Cookie cookie) { if (!(Cookie.class.equals(cookie.getClass()))) { cookie = new Cookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain(), cookie.getVersion()); } headers.add(HttpHeaders.COOKIE, cookie); }
public void cookie(Cookie cookie) { if (!(Cookie.class.equals(cookie.getClass()))) { cookie = new Cookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain(), cookie.getVersion()); } headers.add(HttpHeaders.COOKIE, cookie); }
@Override public Invocation.Builder cookie(Cookie cookie) { if (!(Cookie.class.equals(cookie.getClass()))) { cookie = new Cookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain(), cookie.getVersion()); } getHeaders().cookie(cookie); return this; }
/** * Create a new instance copying the information in the supplied cookie. * @param cookie the cookie to clone * @throws IllegalArgumentException if cookie is null */ public NewCookie(Cookie cookie) { super(cookie==null ? null : cookie.getName(), cookie==null ? null : cookie.getValue(), cookie==null ? null : cookie.getPath(), cookie==null ? null : cookie.getDomain(), cookie==null ? Cookie.DEFAULT_VERSION : cookie.getVersion()); }
public NewCookie(Cookie cookie, String comment, int maxAge, boolean isSecure) { super(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain(), cookie .getVersion()); this.comment = comment; this.maxAge = maxAge; this.isSecure = isSecure; }
/** * Create a new instance copying the information in the supplied cookie. * @param cookie the cookie to clone * @throws IllegalArgumentException if cookie is null */ public NewCookie(Cookie cookie) { super(cookie==null ? null : cookie.getName(), cookie==null ? null : cookie.getValue(), cookie==null ? null : cookie.getPath(), cookie==null ? null : cookie.getDomain(), cookie==null ? Cookie.DEFAULT_VERSION : cookie.getVersion()); }
public NewCookie(Cookie cookie, String comment, int maxAge, Date expiry, boolean secure, boolean httpOnly) { super(cookie == null ? null : cookie.getName(), cookie == null ? null : cookie.getValue(), cookie == null ? null : cookie.getPath(), cookie == null ? null : cookie.getDomain(), cookie == null ? Cookie.DEFAULT_VERSION : cookie.getVersion()); this.comment = comment; this.maxAge = maxAge; this.expiry = expiry; this.secure = secure; this.httpOnly = httpOnly; }
public NewCookie(Cookie cookie, String comment, int maxAge, Date expiry, boolean secure, boolean httpOnly) { super(cookie == null ? null : cookie.getName(), cookie == null ? null : cookie.getValue(), cookie == null ? null : cookie.getPath(), cookie == null ? null : cookie.getDomain(), cookie == null ? Cookie.DEFAULT_VERSION : cookie.getVersion()); this.comment = comment; this.maxAge = maxAge; this.expiry = expiry; this.secure = secure; this.httpOnly = httpOnly; }
@Override public Invocation.Builder cookie(Cookie cookie) { if (!(Cookie.class.equals(cookie.getClass()))) { cookie = new Cookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain(), cookie.getVersion()); } getHeaders().cookie(cookie); return this; }
public NewCookie(Cookie cookie, String comment, int maxAge, Date expiry, boolean secure, boolean httpOnly) { super(cookie == null ? null : cookie.getName(), cookie == null ? null : cookie.getValue(), cookie == null ? null : cookie.getPath(), cookie == null ? null : cookie.getDomain(), cookie == null ? Cookie.DEFAULT_VERSION : cookie.getVersion()); this.comment = comment; this.maxAge = maxAge; this.expiry = expiry; this.secure = secure; this.httpOnly = httpOnly; }
@Override public Cookie getCookie(String cookieName) { Map<String, javax.ws.rs.core.Cookie> cookies = requestContext.getCookies(); if (cookies == null) return null; javax.ws.rs.core.Cookie cookie = cookies.get(cookieName); if (cookie == null) return null; return new Cookie(cookie.getName(), cookie.getValue(), cookie.getVersion(), cookie.getDomain(), cookie.getPath()); }
@Override public String toString(final Cookie cookie) { final HttpCookie httpCookie = new HttpCookie(cookie.getName(), cookie.getValue()); httpCookie.setDomain(cookie.getDomain()); httpCookie.setPath(cookie.getPath()); return httpCookie.toString(); } }