@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(); }
if (!name.equals(((Cookie) v).getName())) { c = new Cookie(name, c.getValue(), c.getPath(), c.getDomain(), c.getVersion()); if (!name.equals(((Cookie) value).getName())) { cookies.add(new Cookie(name, c.getValue(), c.getPath(), c.getDomain(), c.getVersion()));
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; }
@Override public Collection<Cookie> getRequestCookies() { return requestContext.getCookies().values().stream().map(c -> { Cookie nc = new Cookie(c.getName(), c.getValue()); nc.setDomain(c.getDomain()); nc.setPath(c.getPath()); nc.setVersion(c.getVersion()); return nc; }).collect(Collectors.toList()); }
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); }
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; }
/** * 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()); }
@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, boolean isSecure) { super(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain(), cookie .getVersion()); this.comment = comment; this.maxAge = maxAge; this.isSecure = isSecure; }
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; }
/** * 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()); }
/** * 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; }
@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 HttpFacade.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 HttpFacade.Cookie(cookie.getName(), cookie.getValue(), cookie.getVersion(), cookie.getDomain(), cookie.getPath()); }