@Override public String getComment() { return delegate.getComment(); }
private String toString(Cookie cookie) { StringBuilder result = new StringBuilder(Parameters.SMALL_BUFFER_SIZE); result.append(cookie.getName()); result.append("="); result.append(cookie.getValue()); if (cookie.getDomain() != null) { result.append(";domain="); result.append(cookie.getDomain()); } if (cookie.getPath() != null) { result.append(";path="); result.append(cookie.getPath()); } if (cookie.getExpiryDate() != null) { result.append(";expires="); result.append(cookie.getExpiryDate()); } if (cookie.getCommentURL() != null) { result.append(";comment="); result.append(cookie.getComment()); } if (cookie.getCommentURL() != null) { result.append(";comment="); result.append(cookie.getCommentURL()); } return result.toString(); }
public String getComment() { return cookie.getComment(); }
@Override public String getComment() { return delegate.getComment(); }
private void writeObject(ObjectOutputStream out) throws IOException { out.writeObject(cookie.getName()); out.writeObject(cookie.getValue()); out.writeObject(cookie.getComment()); out.writeObject(cookie.getDomain()); out.writeObject(cookie.getExpiryDate()); out.writeObject(cookie.getPath()); out.writeInt(cookie.getVersion()); out.writeBoolean(cookie.isSecure()); }
private void writeObject(ObjectOutputStream out) throws IOException { out.writeObject(cookie.getName()); out.writeObject(cookie.getValue()); out.writeObject(cookie.getComment()); out.writeObject(cookie.getDomain()); out.writeObject(cookie.getExpiryDate()); out.writeObject(cookie.getPath()); out.writeInt(cookie.getVersion()); out.writeBoolean(cookie.isSecure()); }
private Map<String, Object> toMap(final Sid sid, final Cookie cookie) { final Map<String, Object> map = new HashMap<String, Object>(); map.put("sid", DaoUtils.writeSid(sid)); map.put("comment", cookie.getComment()); map.put("domain", cookie.getDomain()); map.put("expiration_date", cookie.getExpiryDate()); map.put("name", cookie.getName()); map.put("path", cookie.getPath()); map.put("value", cookie.getValue()); map.put("version", cookie.getVersion()); return map; } }
private void writeObject(ObjectOutputStream out) throws IOException { out.writeObject(cookie.getName()); out.writeObject(cookie.getValue()); out.writeObject(cookie.getComment()); out.writeObject(cookie.getDomain()); out.writeObject(cookie.getExpiryDate()); out.writeObject(cookie.getPath()); out.writeInt(cookie.getVersion()); out.writeBoolean(cookie.isSecure()); }
Cookie responseCookie = new Cookie(cookieName, cookie.getValue()); responseCookie.setVersion(cookie.getVersion()); responseCookie.setComment(cookie.getComment()); Date expireDate = cookie.getExpiryDate();
@Override public List<javax.servlet.http.Cookie> getCookies() { List<javax.servlet.http.Cookie> result = new LinkedList<javax.servlet.http.Cookie>(); Set<Cookie> cookies = wc.getCookieManager().getCookies(); for (Cookie cookie : cookies) { javax.servlet.http.Cookie c = new javax.servlet.http.Cookie( cookie.getName(), cookie.getValue()); c.setComment(cookie.toHttpClient().getComment()); c.setDomain(cookie.getDomain()); Date expire = cookie.toHttpClient().getExpiryDate(); if (expire == null) { c.setMaxAge(-1); } else { Date now = Calendar.getInstance().getTime(); // Convert milli-second to second Long second = Long.valueOf((expire.getTime() - now.getTime()) / 1000); c.setMaxAge(second.intValue()); } c.setPath(cookie.getPath()); c.setSecure(cookie.toHttpClient().isSecure()); c.setVersion(cookie.toHttpClient().getVersion()); result.add(c); } return result; }
responseCookie.setSecure(isSecureRequest && cookie.isSecure()); responseCookie.setVersion(cookie.getVersion()); responseCookie.setComment(cookie.getComment()); Date expireDate = cookie.getExpiryDate();
appendAttribute(buffer, "Comment", cookie.getComment()); appendAttribute(buffer, "Domain", cookie.getDomain()); appendAttribute(buffer, "Max-Age", maxAge);
private static Cookie rewriteForServer(Cookie cookie, DriverRequest request) { String name = cookie.getName(); if ("_JSESSIONID".equalsIgnoreCase(name)) { name = name.substring(1); } BasicClientCookie2 httpClientCookie = new BasicClientCookie2(name, cookie.getValue()); httpClientCookie.setSecure(false); String domain; if (request.getDriver().getConfiguration().isPreserveHost()) { domain = UriUtils.extractHostName(request.getOriginalRequest().getRequestLine().getUri()); } else { domain = request.getBaseUrl().getHost(); } httpClientCookie.setDomain(domain); httpClientCookie.setPath("/"); httpClientCookie.setComment(cookie.getComment()); httpClientCookie.setVersion(cookie.getVersion()); return httpClientCookie; }
cookieToForward.setComment(cookie.getComment()); cookieToForward.setVersion(cookie.getVersion()); cookieToForward.setExpiryDate(cookie.getExpiryDate());
String comment = cookie.getComment(); if (comment != null) { tree.addText(comment);
String comment = cookie.getComment(); if (comment != null) { tree.addText(comment);