@Test public void urlValidationTest() { assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("https: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("https: assertTrue(Validator.isUrlValid("HTTPS: assertTrue(Validator.isUrlValid("https: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("https: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("https: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("https: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("https: assertTrue(Validator.isUrlValid("http: assertTrue(Validator.isUrlValid("http: assertFalse(Validator.isUrlValid("http: assertFalse(Validator.isUrlValid("example.com")); assertFalse(Validator.isUrlValid("EXAMPLE.COM")); assertFalse(Validator.isUrlValid("www.example.com")); assertFalse(Validator.isUrlValid("WWW.EXAMPLE.COM")); assertFalse(Validator.isUrlValid("ftp: assertFalse(Validator.isUrlValid("ftp: assertFalse(Validator.isUrlValid("example.com/foo/bar")); assertFalse(Validator.isUrlValid("www.example.com/foo/bar")); assertFalse(Validator.isUrlValid("www.example.com:8080")); assertFalse(Validator.isUrlValid("www.example.com:8080/foo/bar")); assertFalse(Validator.isUrlValid("www.example.com/foo%20bar")); assertFalse(Validator.isUrlValid("example.com/foo/bar")); assertFalse(Validator.isUrlValid("www.example.com/foo/bar")); assertFalse(Validator.isUrlValid("www.example.com/foo/bar")); assertFalse(Validator.isUrlValid("www.example.com/foo/捦挺挎/bar")); assertFalse(Validator.isUrlValid("عمان.icom.museum")); assertFalse(Validator.isUrlValid("1964thetribute.com")); assertFalse(Validator.isUrlValid("http:/www.example.com")); assertFalse(Validator.isUrlValid("http:www.example.com")); }
public static boolean isUrlValid(String url) { return Pattern .compile("^https?: .matcher(url) .matches(); }
Validator { public static boolean isUrlValid(String url) { return Pattern .compile("^https?: .matcher(url) .matches(); } }
Validator { public static boolean isUrlValid(String url) { return Pattern .compile("^https?: .matcher(url) .matches(); } private  Validator(); }
Validator { public static boolean isUrlValid(String url) { return Pattern .compile("^https?: .matcher(url) .matches(); } private  Validator(); static boolean isEmailAddressValid(String emailAddress); static boolean isUrlValid(String url); }
Validator { public static boolean isUrlValid(String url) { return Pattern .compile("^https?: .matcher(url) .matches(); } private  Validator(); static boolean isEmailAddressValid(String emailAddress); static boolean isUrlValid(String url);  }