Java Code Examples for java.net.HttpCookie#domainMatches()

The following examples show how to use java.net.HttpCookie#domainMatches() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NonBlockingCookieStore.java    From http-builder-ng with Apache License 2.0 6 votes vote down vote up
private boolean matches(final Map.Entry<Key,HttpCookie> entry, final URI uri) {
    final HttpCookie cookie = entry.getValue();
    final boolean secureLink = "https".equalsIgnoreCase(uri.getScheme());
    if(!secureLink && cookie.getSecure()) {
        return false;
    }
    
    final String host = uri.getHost();
    if(entry.getKey() instanceof UriKey) {
        return ((UriKey) entry.getKey()).host.equalsIgnoreCase(host);
    }
    else {
        final String domain = cookie.getDomain();
        if(cookie.getVersion() == 0) {
            return netscapeDomainMatches(domain, host);
        }
        else {
            return HttpCookie.domainMatches(domain, host);
        }
    }
}
 
Example 2
Source File: TestHttpCookie.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}
 
Example 3
Source File: TestHttpCookie.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}
 
Example 4
Source File: TestHttpCookie.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}
 
Example 5
Source File: TestHttpCookie.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}
 
Example 6
Source File: TestHttpCookie.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}
 
Example 7
Source File: TestHttpCookie.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}
 
Example 8
Source File: TestHttpCookie.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}
 
Example 9
Source File: TestHttpCookie.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}
 
Example 10
Source File: TestHttpCookie.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}
 
Example 11
Source File: TestHttpCookie.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}
 
Example 12
Source File: PersistentCookieStore.java    From httplite with Apache License 2.0 5 votes vote down vote up
public int compareTo(String domain) {
    if (HttpCookie.domainMatches(domain, host)) {
        return 0;
    } else {
        return -1;
    }
}
 
Example 13
Source File: TestHttpCookie.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}
 
Example 14
Source File: TestHttpCookie.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}
 
Example 15
Source File: TestHttpCookie.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
static void dm(String domain, String host, boolean matches) {
    testCount++;
    if (HttpCookie.domainMatches(domain, host) != matches) {
        raiseError("Host " + host + (matches?" should ":" should not ") +
                    "domain-match with domain " + domain);
    }
}