List of usage examples for org.apache.http.cookie ClientCookie containsAttribute
boolean containsAttribute(String name);
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 ww . j a v a 2s. c o m*/ } 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)); } } }