Java 类org.apache.http.client.utils.Punycode 实例源码
项目:lams
文件:PublicSuffixFilter.java
private boolean isForPublicSuffix(Cookie cookie) {
String domain = cookie.getDomain();
if (domain.startsWith(".")) domain = domain.substring(1);
domain = Punycode.toUnicode(domain);
// An exception rule takes priority over any other matching rule.
if (this.exceptions != null) {
if (this.exceptions.contains(domain)) return false;
}
if (this.suffixes == null) return false;
do {
if (this.suffixes.contains(domain)) return true;
// patterns
if (domain.startsWith("*.")) domain = domain.substring(2);
int nextdot = domain.indexOf('.');
if (nextdot == -1) break;
domain = "*" + domain.substring(nextdot);
} while (domain.length() > 0);
return false;
}
项目:cJUnit-mc626
文件:PublicSuffixFilter.java
private boolean isForPublicSuffix(Cookie cookie) {
String domain = cookie.getDomain();
if (domain.startsWith(".")) domain = domain.substring(1);
domain = Punycode.toUnicode(domain);
// An exception rule takes priority over any other matching rule.
if (this.exceptions != null) {
if (this.exceptions.contains(domain)) return false;
}
if (this.suffixes == null) return false;
do {
if (this.suffixes.contains(domain)) return true;
// patterns
if (domain.startsWith("*.")) domain = domain.substring(2);
int nextdot = domain.indexOf('.');
if (nextdot == -1) break;
domain = "*" + domain.substring(nextdot);
} while (domain.length() > 0);
return false;
}
项目:remote-files-sync
文件:PublicSuffixFilterHC4.java
private boolean isForPublicSuffix(final Cookie cookie) {
String domain = cookie.getDomain();
if (domain.startsWith(".")) {
domain = domain.substring(1);
}
domain = Punycode.toUnicode(domain);
// An exception rule takes priority over any other matching rule.
if (this.exceptions != null) {
if (this.exceptions.contains(domain)) {
return false;
}
}
if (this.suffixes == null) {
return false;
}
do {
if (this.suffixes.contains(domain)) {
return true;
}
// patterns
if (domain.startsWith("*.")) {
domain = domain.substring(2);
}
final int nextdot = domain.indexOf('.');
if (nextdot == -1) {
break;
}
domain = "*" + domain.substring(nextdot);
} while (domain.length() > 0);
return false;
}
项目:Visit
文件:PublicSuffixFilterHC4.java
private boolean isForPublicSuffix(final Cookie cookie) {
String domain = cookie.getDomain();
if (domain.startsWith(".")) {
domain = domain.substring(1);
}
domain = Punycode.toUnicode(domain);
// An exception rule takes priority over any other matching rule.
if (this.exceptions != null) {
if (this.exceptions.contains(domain)) {
return false;
}
}
if (this.suffixes == null) {
return false;
}
do {
if (this.suffixes.contains(domain)) {
return true;
}
// patterns
if (domain.startsWith("*.")) {
domain = domain.substring(2);
}
final int nextdot = domain.indexOf('.');
if (nextdot == -1) {
break;
}
domain = "*" + domain.substring(nextdot);
} while (domain.length() > 0);
return false;
}
项目:ZTLib
文件:PublicSuffixFilterHC4.java
private boolean isForPublicSuffix(final Cookie cookie) {
String domain = cookie.getDomain();
if (domain.startsWith(".")) {
domain = domain.substring(1);
}
domain = Punycode.toUnicode(domain);
// An exception rule takes priority over any other matching rule.
if (this.exceptions != null) {
if (this.exceptions.contains(domain)) {
return false;
}
}
if (this.suffixes == null) {
return false;
}
do {
if (this.suffixes.contains(domain)) {
return true;
}
// patterns
if (domain.startsWith("*.")) {
domain = domain.substring(2);
}
final int nextdot = domain.indexOf('.');
if (nextdot == -1) {
break;
}
domain = "*" + domain.substring(nextdot);
} while (domain.length() > 0);
return false;
}