Example usage for org.apache.http.cookie ClientCookie getAttribute

List of usage examples for org.apache.http.cookie ClientCookie getAttribute

Introduction

In this page you can find the example usage for org.apache.http.cookie ClientCookie getAttribute.

Prototype

String getAttribute(String name);

Source Link

Usage

From source file:com.github.tmyroadctfig.icloud4j.json.SerializableClientCookie.java

private void copyAttribute(String name, ClientCookie from) {
    String value = from.getAttribute(name);
    if (value != null)
        attribs.put(name, value);/*from w  w  w .  java 2s.c o  m*/
}

From source file:org.esxx.js.protocol.CookieJar.java

private void setValue(Context cx, Cookie cookie, Scriptable js, Scriptable raw, String name, Object value) {
    if (value instanceof String || value instanceof Number || value instanceof Boolean) {
        js.put(name, js, value);/*from  w  w  w  .  ja v a  2 s.  c om*/
    } else if (value instanceof Date) {
        js.put(name, js, ((Date) value).getTime());
    } else if (value instanceof int[]) {
        int[] ports = (int[]) value;
        Object[] ip = new Object[ports.length];

        for (int i = 0; i < ports.length; ++i) {
            ip[i] = i;
        }

        js.put(name, js, cx.newArray(jsuri, ip));
    }

    // Add raw attribute, if present
    if (cookie instanceof ClientCookie) {
        ClientCookie cc = (ClientCookie) cookie;

        if (cc.containsAttribute(name)) {
            raw.put(name, raw, cc.getAttribute(name));
        }
    }
}