下面列出了java.net.HttpCookie#domainMatches ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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);
}
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
public int compareTo(String domain) {
if (HttpCookie.domainMatches(domain, host)) {
return 0;
} else {
return -1;
}
}
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);
}
}
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);
}
}
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);
}
}