Package java.net

Examples of java.net.HttpCookie$CookieAttributeAssignor


         this(cookie, cookie.getMaxAge(), creationTime);
      }

      public Cookie(String name, String value, int secondsBeforeExpiration)
      {
         this(new HttpCookie(name, value), secondsBeforeExpiration, System.currentTimeMillis());
      }
View Full Code Here


                List<HttpCookie> indexedCookies = cookieIndex.get(index);
                // check the list of cookies associated with this domain
                if (indexedCookies != null) {
                    Iterator<HttpCookie> it = indexedCookies.iterator();
                    while (it.hasNext()) {
                        HttpCookie ck = it.next();
                        if (cookieJar.indexOf(ck) != -1) {
                            // the cookie still in main cookie store
                            if (!ck.hasExpired()) {
                                // don't add twice
                                if (!cookies.contains(ck))
                                    cookies.add(ck);
                            } else {
                                it.remove();
View Full Code Here

        }
    }

    // check name
    TestHttpCookie n(int index, String n) {
        HttpCookie cookie = cookies.get(index);
        if (cookie == null || !n.equalsIgnoreCase(cookie.getName())) {
            raiseError("name", cookie.getName(), n);
        }

        return this;
    }
View Full Code Here

    }
    TestHttpCookie n(String n) { return n(0, n); }

    // check value
    TestHttpCookie v(int index, String v) {
        HttpCookie cookie = cookies.get(index);
        if (cookie == null || !v.equals(cookie.getValue())) {
            raiseError("value", cookie.getValue(), v);
        }

        return this;
    }
View Full Code Here

    }
    TestHttpCookie v(String v) { return v(0, v); }

    // check version
    TestHttpCookie ver(int index, int ver) {
        HttpCookie cookie = cookies.get(index);
        if (cookie == null || (ver != cookie.getVersion())) {
            raiseError("version", Integer.toString(cookie.getVersion()), Integer.toString(ver));
        }

        return this;
    }
View Full Code Here

    }
    TestHttpCookie ver(int ver) { return ver(0, ver); }

    // check path
    TestHttpCookie p(int index, String p) {
        HttpCookie cookie = cookies.get(index);
        if (cookie == null || !p.equals(cookie.getPath())) {
            raiseError("path", cookie.getPath(), p);
        }

        return this;
    }
View Full Code Here

        return this;
    }

    // check comment
    TestHttpCookie c(int index, String c) {
        HttpCookie cookie = cookies.get(index);
        if (cookie == null || !c.equals(cookie.getComment())) {
            raiseError("comment", cookie.getComment(), c);
        }

        return this;
    }
View Full Code Here

    }
    TestHttpCookie c(String c) { return c(0, c); }

    // check comment url
    TestHttpCookie cu(int index, String cu) {
        HttpCookie cookie = cookies.get(index);
        if (cookie == null || !cu.equals(cookie.getCommentURL())) {
            raiseError("comment url", cookie.getCommentURL(), cu);
        }

        return this;
    }
View Full Code Here

    }
    TestHttpCookie cu(String cu) { return cu(0, cu); }

    // check discard
    TestHttpCookie dsc(int index, boolean dsc) {
        HttpCookie cookie = cookies.get(index);
        if (cookie == null || (dsc != cookie.getDiscard())) {
            raiseError("discard", Boolean.toString(cookie.getDiscard()), Boolean.toString(dsc));
        }

        return this;
    }
View Full Code Here

    }
    TestHttpCookie dsc(boolean dsc) { return dsc(0, dsc); }

    // check domain
    TestHttpCookie d(int index, String d) {
        HttpCookie cookie = cookies.get(index);
        if (cookie == null || !d.equalsIgnoreCase(cookie.getDomain())) {
            raiseError("domain", cookie.getDomain(), d);
        }

        return this;
    }
View Full Code Here

TOP

Related Classes of java.net.HttpCookie$CookieAttributeAssignor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.