in src/main/java/org/apache/commons/validator/routines/UrlValidator.java [263:286]
public UrlValidator(String[] schemes, final RegexValidator authorityValidator, final long options, final DomainValidator domainValidator) {
this.options = options;
if (domainValidator == null) {
throw new IllegalArgumentException("DomainValidator must not be null");
}
if (domainValidator.isAllowLocal() != ((options & ALLOW_LOCAL_URLS) > 0)){
throw new IllegalArgumentException("DomainValidator disagrees with ALLOW_LOCAL_URLS setting");
}
this.domainValidator = domainValidator;
if (isOn(ALLOW_ALL_SCHEMES)) {
allowedSchemes = Collections.emptySet();
} else {
if (schemes == null) {
schemes = DEFAULT_SCHEMES;
}
allowedSchemes = new HashSet<>(schemes.length);
for (final String scheme : schemes) {
allowedSchemes.add(scheme.toLowerCase(Locale.ENGLISH));
}
}
this.authorityValidator = authorityValidator;
}