Examples of BasicClientCookie2


Examples of org.apache.http.impl.cookie.BasicClientCookie2

    @Before
    public void setUp() {
        this.target = new HttpHost("localhost.local", 80);
        this.cookieStore = new BasicCookieStore();
        final BasicClientCookie2 cookie1 = new BasicClientCookie2("name1", "value1");
        cookie1.setVersion(1);
        cookie1.setDomain("localhost.local");
        cookie1.setPath("/");
        this.cookieStore.addCookie(cookie1);
        final BasicClientCookie2 cookie2 = new BasicClientCookie2("name2", "value2");
        cookie2.setVersion(1);
        cookie2.setDomain("localhost.local");
        cookie2.setPath("/");
        this.cookieStore.addCookie(cookie2);

        this.cookieSpecRegistry = RegistryBuilder.<CookieSpecProvider>create()
            .register(CookieSpecs.DEFAULT, new DefaultCookieSpecProvider())
            .register(CookieSpecs.STANDARD, new RFC2965SpecProvider())
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie2

    @Test
    public void testExcludeExpiredCookies() throws Exception {
        final HttpRequest request = new BasicHttpRequest("GET", "/");

        final BasicClientCookie2 cookie3 = new BasicClientCookie2("name3", "value3");
        cookie3.setVersion(1);
        cookie3.setDomain("localhost.local");
        cookie3.setPath("/");
        cookie3.setExpiryDate(new Date(System.currentTimeMillis() - (24 * 60 * 60 * 1000)));

        this.cookieStore.addCookie(cookie3);

        final HttpRoute route = new HttpRoute(this.target, null, false);

View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie2

    @Before
    public void setUp() {
        this.target = new HttpHost("localhost.local", 80);
        this.cookieStore = new BasicCookieStore();
        BasicClientCookie2 cookie1 = new BasicClientCookie2("name1", "value1");
        cookie1.setVersion(1);
        cookie1.setDomain("localhost.local");
        cookie1.setPath("/");
        this.cookieStore.addCookie(cookie1);
        BasicClientCookie2 cookie2 = new BasicClientCookie2("name2", "value2");
        cookie2.setVersion(1);
        cookie2.setDomain("localhost.local");
        cookie2.setPath("/");
        this.cookieStore.addCookie(cookie2);

        this.cookieSpecRegistry = new CookieSpecRegistry();
        this.cookieSpecRegistry.register(
                CookiePolicy.BEST_MATCH,
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie2

    @Test
    public void testExcludeExpiredCookies() throws Exception {
        HttpRequest request = new BasicHttpRequest("GET", "/");

        BasicClientCookie2 cookie3 = new BasicClientCookie2("name3", "value3");
        cookie3.setVersion(1);
        cookie3.setDomain("localhost.local");
        cookie3.setPath("/");
        cookie3.setExpiryDate(new Date(System.currentTimeMillis() - (24 * 60 * 60 * 1000)));

        this.cookieStore.addCookie(cookie3);

        HttpRoute route = new HttpRoute(this.target, null, false);

View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie2

    while (i < result.getRowCount())
    {
      IResultRow row = result.getRow(i++);
      String name = (String)row.getValue(nameField);
      String value = (String)row.getValue(valueField);
      BasicClientCookie2 c = new BasicClientCookie2(name,value);
      String domain = (String)row.getValue(domainField);
      if (domain != null && domain.length() > 0)
        c.setDomain(domain);
      //c.setDomainAttributeSpecified(stringToBoolean((String)row.getValue(domainSpecifiedField)));
      String path = (String)row.getValue(pathField);
      if (path != null && path.length() > 0)
        c.setPath(path);
      //c.setPathAttributeSpecified(stringToBoolean((String)row.getValue(pathSpecifiedField)));
      Long version = (Long)row.getValue(versionField);
      if (version != null)
        c.setVersion((int)version.longValue());
      //c.setVersionAttributeSpecified(stringToBoolean((String)row.getValue(versionSpecifiedField)));
      String comment = (String)row.getValue(commentField);
      if (comment != null)
        c.setComment(comment);
      c.setSecure(stringToBoolean((String)row.getValue(secureField)));
      Long expirationDate = (Long)row.getValue(expirationDateField);
      if (expirationDate != null)
        c.setExpiryDate(new Date(expirationDate.longValue()));
      c.setDiscard(stringToBoolean((String)row.getValue(discardField)));
      String commentURL = (String)row.getValue(commentURLField);
      if (commentURL != null && commentURL.length() > 0)
        c.setCommentURL(commentURL);
      String ports = (String)row.getValue(portField);
      // Ports are comma-separated
      if (ports != null && ports.length() > 0)
        c.setPorts(stringToPorts(ports));
      //c.setPortAttributeBlank(stringToBoolean((String)row.getValue(portBlankField)));
      //c.setPortAttributeSpecified(stringToBoolean((String)row.getValue(portSpecifiedField)));

      dcs.addCookie(c);
    }
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie2

    @Before
    public void setUp() {
        this.target = new HttpHost("localhost.local", 80);
        this.cookieStore = new BasicCookieStore();
        BasicClientCookie2 cookie1 = new BasicClientCookie2("name1", "value1");
        cookie1.setVersion(1);
        cookie1.setDomain("localhost.local");
        cookie1.setPath("/");
        this.cookieStore.addCookie(cookie1);
        BasicClientCookie2 cookie2 = new BasicClientCookie2("name2", "value2");
        cookie2.setVersion(1);
        cookie2.setDomain("localhost.local");
        cookie2.setPath("/");
        this.cookieStore.addCookie(cookie2);

        this.cookieSpecRegistry = new CookieSpecRegistry();
        this.cookieSpecRegistry.register(
                CookiePolicy.BEST_MATCH,
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie2

    @Test
    public void testExcludeExpiredCookies() throws Exception {
        HttpRequest request = new BasicHttpRequest("GET", "/");

        BasicClientCookie2 cookie3 = new BasicClientCookie2("name3", "value3");
        cookie3.setVersion(1);
        cookie3.setDomain("localhost.local");
        cookie3.setPath("/");
        cookie3.setExpiryDate(new Date(System.currentTimeMillis() - (24 * 60 * 60 * 1000)));

        this.cookieStore.addCookie(cookie3);

        HttpRoute route = new HttpRoute(this.target, null, false);

View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie2

    @Before
    public void setUp() {
        this.target = new HttpHost("localhost.local", 80);
        this.cookieStore = new BasicCookieStore();
        final BasicClientCookie2 cookie1 = new BasicClientCookie2("name1", "value1");
        cookie1.setVersion(1);
        cookie1.setDomain("localhost.local");
        cookie1.setPath("/");
        this.cookieStore.addCookie(cookie1);
        final BasicClientCookie2 cookie2 = new BasicClientCookie2("name2", "value2");
        cookie2.setVersion(1);
        cookie2.setDomain("localhost.local");
        cookie2.setPath("/");
        this.cookieStore.addCookie(cookie2);

        this.cookieSpecRegistry = RegistryBuilder.<CookieSpecProvider>create()
            .register(CookieSpecs.BEST_MATCH, new BestMatchSpecFactory())
            .register(CookieSpecs.BROWSER_COMPATIBILITY, new BrowserCompatSpecFactory())
View Full Code Here

Examples of org.apache.http.impl.cookie.BasicClientCookie2

    @Test
    public void testExcludeExpiredCookies() throws Exception {
        final HttpRequest request = new BasicHttpRequest("GET", "/");

        final BasicClientCookie2 cookie3 = new BasicClientCookie2("name3", "value3");
        cookie3.setVersion(1);
        cookie3.setDomain("localhost.local");
        cookie3.setPath("/");
        cookie3.setExpiryDate(new Date(System.currentTimeMillis() - (24 * 60 * 60 * 1000)));

        this.cookieStore.addCookie(cookie3);

        final HttpRoute route = new HttpRoute(this.target, null, false);

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.