gpt4 book ai didi

java - EmailValidator GetInstance本地吗?

转载 作者:行者123 更新时间:2023-12-04 02:16:55 24 4
gpt4 key购买 nike

抱歉,如果在此之前的某个地方问过这个问题。我搜索了但没有找到答案。

我对Apache EmailValidator有疑问。我想使用此类来验证表单中的电子邮件,但我不了解这两种方法之间的区别:

static EmailValidator   getInstance()

static EmailValidator getInstance(boolean allowLocal)


这里是文档: https://commons.apache.org/proper/commons-validator/apidocs/index.html

我不确定,但是 allowLocal是什么意思?

该文档说:


是否应将本地地址视为有效地址?


但是什么是本地地址?

最佳答案

.localhost.localdomain结尾的地址。例如,admin@server1.localhostdave@mailserver.acme.localdomain。来自org/apache/commons/validator/routines/DomainValidator.java

// WARNING: this array MUST be sorted, otherwise it cannot be searched reliably using binary search
private static final String[] LOCAL_TLDS = new String[] {
"localdomain", // Also widely used as localhost.localdomain
"localhost", // RFC2606 defined
};

关于java - EmailValidator GetInstance本地吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38876616/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com