StringBuilderUtils.appendQuotedIfWhitespace(b, cookie.getValue());
StringBuilderUtils.appendQuotedIfWhitespace(b, cookie.getValue());
public void addNewCookie(NewCookie cookie) { Cookie cook = new Cookie(cookie.getName(), cookie.getValue()); cook.setMaxAge(cookie.getMaxAge()); cook.setVersion(cookie.getVersion()); if (cookie.getDomain() != null) cook.setDomain(cookie.getDomain()); if (cookie.getPath() != null) cook.setPath(cookie.getPath()); cook.setSecure(cookie.isSecure()); if (cookie.getComment() != null) cook.setComment(cookie.getComment()); response.addCookie(cook); }
/** * Obtain a new instance of a {@link Cookie} with the same name, value, path, * domain and version as this {@code NewCookie}. This method can be used to * obtain an object that can be compared for equality with another {@code Cookie}; * since a {@code Cookie} will never compare equal to a {@code NewCookie}. * * @return a {@link Cookie} */ public Cookie toCookie() { return new Cookie(this.getName(), this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); }
@Test public void shouldPersistAsInRfcErrata() { final ClientSideState clientSideState = new ClientSideState(RFC_EDITION, RFC_TIME, RFC_IV_SOURCE, SIMPLE_SERIALIZATION, SIMPLE_DESERIALIZATION, ClientSideState.DEFAULT_TIMEOUT); final NewCookie cookie = clientSideState.persist("id", "/path", "a state string"); assertThat(cookie).isNotNull(); assertThat(cookie.getName()).isEqualTo("id"); assertThat(cookie.getValue()) .isEqualTo("pzSOjcNui9-HWS_Qk1Pwpg|MTM0NzI2NTk1NQ|dGlk|tL3lJPf2nUSFMN6dtVXJTw|uea1fgC67RmOxfpNz8gMbnPWfDA"); assertThat(cookie.getPath()).isEqualTo("/path"); assertThat(cookie.isHttpOnly()).isFalse(); assertThat(cookie.isSecure()).isTrue(); }
/** * Obtain a new instance of a {@link Cookie} with the same name, value, path, * domain and version as this {@code NewCookie}. This method can be used to * obtain an object that can be compared for equality with another {@code Cookie}; * since a {@code Cookie} will never compare equal to a {@code NewCookie}. * * @return a {@link Cookie} */ public Cookie toCookie() { return new Cookie(this.getName(), this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); }
/** * Obtain a new instance of a {@link Cookie} with the same name, value, path, * domain and version as this {@code NewCookie}. This method can be used to * obtain an object that can be compared for equality with another {@code Cookie}; * since a {@code Cookie} will never compare equal to a {@code NewCookie}. * * @return a {@link Cookie} */ public Cookie toCookie() { return new Cookie(this.getName(), this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); }
/** * Obtain a new instance of a {@link Cookie} with the same name, value, path, * domain and version as this {@code NewCookie}. This method can be used to * obtain an object that can be compared for equality with another {@code Cookie}; * since a {@code Cookie} will never compare equal to a {@code NewCookie}. * * @return a {@link Cookie} */ public Cookie toCookie() { return new Cookie(this.getName(), this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); }
private String parseCookie(NewCookie cookie) { // Don't use cookie.getName(). `Cookie` is meant for server usage, so we pull the name from the annotation String result = getName() + '=' + cookie.getValue(); result += maxAgeOrEmpty(cookie); result += domainOrEmpty(cookie); result += pathOrEmpty(cookie); result += secureOrEmpty(cookie); return result; }
/** * Obtain a new instance of a {@link Cookie} with the same name, value, path, * domain and version as this {@code NewCookie}. This method can be used to * obtain an object that can be compared for equality with another {@code Cookie}; * since a {@code Cookie} will never compare equal to a {@code NewCookie}. * * @return a {@link Cookie} */ public Cookie toCookie() { return new Cookie(this.getName(), this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); }
/** * Obtain a new instance of a {@link Cookie} with the same name, value, path, * domain and version as this {@code NewCookie}. This method can be used to * obtain an object that can be compared for equality with another {@code Cookie}; * since a {@code Cookie} will never compare equal to a {@code NewCookie}. * * @return a {@link Cookie} */ public Cookie toCookie() { return new Cookie(this.getName(), this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); }
/** * Obtain a new instance of a {@link Cookie} with the same name, value, path, * domain and version as this {@code NewCookie}. This method can be used to * obtain an object that can be compared for equality with another {@code Cookie}; * since a {@code Cookie} will never compare equal to a {@code NewCookie}. * * @return a {@link Cookie} */ public Cookie toCookie() { return new Cookie(this.getName(), this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); }
/** * Obtain a new instance of a {@link Cookie} with the same name, value, path, * domain and version as this {@code NewCookie}. This method can be used to * obtain an object that can be compared for equality with another {@code Cookie}; * since a {@code Cookie} will never compare equal to a {@code NewCookie}. * @return a {@link Cookie} */ public Cookie toCookie() { return new Cookie(this.getName(),this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); }
/** * Obtain a new instance of a {@link Cookie} with the same name, value, path, * domain and version as this {@code NewCookie}. This method can be used to * obtain an object that can be compared for equality with another {@code Cookie}; * since a {@code Cookie} will never compare equal to a {@code NewCookie}. * * @return a {@link Cookie} */ public Cookie toCookie() { return new Cookie(this.getName(), this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); }
/** * Obtain a new instance of a {@link Cookie} with the same name, value, path, * domain and version as this {@code NewCookie}. This method can be used to * obtain an object that can be compared for equality with another {@code Cookie}; * since a {@code Cookie} will never compare equal to a {@code NewCookie}. * @return a {@link Cookie} */ public Cookie toCookie() { return new Cookie(this.getName(),this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); }
/** * Obtain a new instance of a {@link Cookie} with the same name, value, path, * domain and version as this {@code NewCookie}. This method can be used to * obtain an object that can be compared for equality with another {@code Cookie}; * since a {@code Cookie} will never compare equal to a {@code NewCookie}. * * @return a {@link Cookie} */ public Cookie toCookie() { return new Cookie(this.getName(), this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); }
/** * Obtain a new instance of a {@link Cookie} with the same name, value, path, * domain and version as this {@code NewCookie}. This method can be used to * obtain an object that can be compared for equality with another {@code Cookie}; * since a {@code Cookie} will never compare equal to a {@code NewCookie}. * @return a {@link Cookie} */ public Cookie toCookie() { return new Cookie(this.getName(),this.getValue(), this.getPath(), this.getDomain(), this.getVersion()); }
@Override public String toString(NewCookie cookie) { if (cookie == null) { throw new IllegalArgumentException("Cookie is null"); } return buildCookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain(), cookie.getVersion(), cookie.getComment(), cookie.getMaxAge(), cookie.isSecure()); }
public String toString(NewCookie cookie) { if (cookie == null) { throw new IllegalArgumentException(Messages.getMessage("cookieIsNull")); //$NON-NLS-1$ } return buildCookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie .getDomain(), cookie.getVersion(), cookie.getComment(), cookie.getMaxAge(), cookie .isSecure()); }