public void testValidator202() { String[] schemes = {"http","https"}; UrlValidator urlValidator = new UrlValidator(schemes, UrlValidator.NO_FRAGMENTS); urlValidator.isValid("http://www.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.logoworks.comwww.log"); }
public void testValidator204() { String[] schemes = {"http","https"}; UrlValidator urlValidator = new UrlValidator(schemes); assertTrue(urlValidator.isValid("http://tech.yahoo.com/rc/desktops/102;_ylt=Ao8yevQHlZ4On0O3ZJGXLEQFLZA5")); }
/** * <p>Checks if a field is a valid url address.</p> * If you need to modify what is considered valid then * consider using the UrlValidator directly. * * @param value The value validation is being performed on. * @return true if the value is valid Url. */ public static boolean isUrl(String value) { return URL_VALIDATOR.isValid(value); }
@Override public boolean check(final String value) { return URL_VALIDATOR.isValid(Constants.HTTP + value); }
@Override public boolean validate(String value) { System.out.println("Validating " + value); String[] schemes = {"http", "https", "ftp"}; UrlValidator urlValidator = new UrlValidator(schemes); return value.isEmpty() || urlValidator.isValid(value); }
private void isValidUri(StartupForm target, List<String> errors, String uri) { if (!isNullOrEmpty(target.getQueueUrl()) && !urlValidator.isValid(uri)) { errors.add(String.format(ERROR_INVALID, QUEUE_URL)); } }
public static void validateUrl(Errors errors, String dbUrlField) { String value = errors.getFieldValue(dbUrlField).toString().replace("localhost", "127.0.0.1"); UrlValidator urlValidator = new UrlValidator(UrlValidator.ALLOW_ALL_SCHEMES); if (!urlValidator.isValid(value)) { errors.rejectValue(dbUrlField, String.format("server.error.invalid.%s", dbUrlField)); } }
/** * method that validates an url address. * it uses the commons-validator */ public void validate( FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException { if (facesContext == null) throw new NullPointerException("facesContext"); if (uiComponent == null) throw new NullPointerException("uiComponent"); if (value == null) { return; } org.apache.commons.validator.UrlValidator urlValidator = initValidator(); if (!urlValidator.isValid(value.toString())) { Object[] args = {value.toString()}; throw new ValidatorException(getFacesMessage(URL_MESSAGE_ID, args)); } }
/** * method that validates an url address. * it uses the commons-validator */ public void validate( FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException { if (facesContext == null) throw new NullPointerException("facesContext"); if (uiComponent == null) throw new NullPointerException("uiComponent"); if (value == null) { return; } org.apache.commons.validator.UrlValidator urlValidator = initValidator(); if (!urlValidator.isValid(value.toString())) { Object[] args = {value.toString()}; throw new ValidatorException(getFacesMessage(URL_MESSAGE_ID, args)); } }
if (!urlValidator.isValid(value.toString()))
@Override public void validate(StartupForm target, List<String> errors, ConfigSource configSource) { if (isNullOrEmpty(target.getProviderName())) { if (!configSource.isFile()) { errors.add(String.format(ERROR_REQUIRED, PROVIDER_NAME)); } } if (isNullOrEmpty(target.getProviderUrl())) { errors.add(String.format(ERROR_REQUIRED, PROVIDER_URL)); } else if (!urlValidator.isValid(target.getProviderUrl())) { errors.add(String.format(ERROR_INVALID, PROVIDER_URL)); } } }
if (urlValidator.isValid(value)) { return true;
if (new UrlValidator(customSchemes).isValid(val)) { foundURL = true; } else { if (new UrlValidator(customSchemes).isValid(val1)) { foundURL = true; } else { if (new UrlValidator(customSchemes).isValid(val)) { foundURL = true; } else { String[] customSchemes = {"http", "https"}; String url = urlStyleMatcher.group(1); if (!new UrlValidator(customSchemes).isValid(url)) { ret.invalidTags.add(tag + " " + attr + " " + styleValue); continue;
if (urlValidator.isValid(value)) { return true; } else {
if (urlValidator.isValid(value)) { return true; } else {