Search in sources :

Example 1 with Uri

use of org.ovirt.engine.ui.uicommonweb.Uri in project ovirt-engine by oVirt.

the class UrlValidation method validate.

@Override
public ValidationResult validate(Object value) {
    Uri uri = new Uri((String) value);
    ValidationResult res = new ValidationResult();
    if (!uri.isValid()) {
        res.setSuccess(false);
        res.getReasons().add(getUriMessage());
        return res;
    }
    res = getHostValidation().validate(uri.getAuthority().getHost());
    String scheme = uri.getScheme();
    if (!allowedSchemes.contains(scheme)) {
        res.setSuccess(false);
        res.getReasons().add(getSchemeMessage(scheme));
    }
    return res;
}
Also used : Uri(org.ovirt.engine.ui.uicommonweb.Uri)

Aggregations

Uri (org.ovirt.engine.ui.uicommonweb.Uri)1