Java Code Examples for org.apache.commons.validator.routines.DomainValidator#updateTLDOverride()

The following examples show how to use org.apache.commons.validator.routines.DomainValidator#updateTLDOverride() . 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: ClientRegistrationService.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
public void setAdditionalTLDs(List<String> additionalTLDs) {
    // Support additional top level domains
    if (additionalTLDs != null && !additionalTLDs.isEmpty()) {
        try {
            LOG.info("Adding the following additional Top Level Domains: " + additionalTLDs);
            DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, additionalTLDs.toArray(new String[0]));
        } catch (IllegalStateException ex) {
            //
        }
    }
}
 
Example 2
Source File: CommonsURLValidator.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
public void setAdditionalTLDs(List<String> additionalTLDs) {
    // Support additional top level domains
    if (additionalTLDs != null && !additionalTLDs.isEmpty()) {
        try {
            String[] tldsToAddArray = additionalTLDs.toArray(new String[0]);
            LOG.info("Adding the following additional Top Level Domains: " + Arrays.toString(tldsToAddArray));
            DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, tldsToAddArray);
        } catch (IllegalStateException ex) {
            //
        }
    }
}