Example usage for java.net HttpCookie getCommentURL

List of usage examples for java.net HttpCookie getCommentURL

Introduction

In this page you can find the example usage for java.net HttpCookie getCommentURL.

Prototype

public String getCommentURL() 

Source Link

Document

Returns the comment URL describing the purpose of this cookie, or null if the cookie has no comment URL.

Usage

From source file:Main.java

public static void main(String[] args) throws Exception {
    CookieManager cm = new CookieManager();
    cm.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
    CookieHandler.setDefault(cm);

    new URL("http://google.com").openConnection().getContent();

    List<HttpCookie> cookies = cm.getCookieStore().getCookies();
    for (HttpCookie cookie : cookies) {
        System.out.println(cookie.getCommentURL());
        System.out.println();/*  www.ja v a2 s . co  m*/
    }
}

From source file:at.becast.youploader.youtube.data.Cookie.java

public Cookie(final HttpCookie cookie) {
    name = cookie.getName();/*from  ww w  .  j  a  va  2  s .c  om*/
    value = cookie.getValue();
    comment = cookie.getComment();
    commentUrl = cookie.getCommentURL();
    domain = cookie.getDomain();
    discard = cookie.getDiscard();
    maxAge = cookie.getMaxAge();
    path = cookie.getPath();
    portList = cookie.getPortlist();
    secure = cookie.getSecure();
    version = cookie.getVersion();
}

From source file:org.openhab.binding.amazonechocontrol.internal.Connection.java

public String serializeLoginData() {
    Date loginTime = this.loginTime;
    if (refreshToken == null || loginTime == null) {
        return "";
    }/*from w  w  w. java 2  s.  com*/
    StringBuilder builder = new StringBuilder();
    builder.append("6\n"); // version
    builder.append(frc);
    builder.append("\n");
    builder.append(serial);
    builder.append("\n");
    builder.append(deviceId);
    builder.append("\n");
    builder.append(refreshToken);
    builder.append("\n");
    builder.append(amazonSite);
    builder.append("\n");
    builder.append(deviceName);
    builder.append("\n");
    builder.append(accountCustomerId);
    builder.append("\n");
    builder.append(loginTime.getTime());
    builder.append("\n");
    List<HttpCookie> cookies = cookieManager.getCookieStore().getCookies();
    builder.append(cookies.size());
    builder.append("\n");
    for (HttpCookie cookie : cookies) {
        writeValue(builder, cookie.getName());
        writeValue(builder, cookie.getValue());
        writeValue(builder, cookie.getComment());
        writeValue(builder, cookie.getCommentURL());
        writeValue(builder, cookie.getDomain());
        writeValue(builder, cookie.getMaxAge());
        writeValue(builder, cookie.getPath());
        writeValue(builder, cookie.getPortlist());
        writeValue(builder, cookie.getVersion());
        writeValue(builder, cookie.getSecure());
        writeValue(builder, cookie.getDiscard());
    }
    return builder.toString();
}