@Test public void testIsValidUrl() { String url = "http: assertThat(UrlUtil.isValidURL(url)).isTrue(); }
public static boolean isValidURL(String url) { if (StringUtils.isBlank(url)) { return false; } try { URL u = new URL(url); u.toURI(); } catch (MalformedURLException | URISyntaxException e) { return false; } return true; }
UrlUtil { public static boolean isValidURL(String url) { if (StringUtils.isBlank(url)) { return false; } try { URL u = new URL(url); u.toURI(); } catch (MalformedURLException | URISyntaxException e) { return false; } return true; } }
UrlUtil { public static boolean isValidURL(String url) { if (StringUtils.isBlank(url)) { return false; } try { URL u = new URL(url); u.toURI(); } catch (MalformedURLException | URISyntaxException e) { return false; } return true; } @SuppressWarnings("unused") private  UrlUtil(); }
UrlUtil { public static boolean isValidURL(String url) { if (StringUtils.isBlank(url)) { return false; } try { URL u = new URL(url); u.toURI(); } catch (MalformedURLException | URISyntaxException e) { return false; } return true; } @SuppressWarnings("unused") private  UrlUtil(); static boolean isValidURL(String url); }
UrlUtil { public static boolean isValidURL(String url) { if (StringUtils.isBlank(url)) { return false; } try { URL u = new URL(url); u.toURI(); } catch (MalformedURLException | URISyntaxException e) { return false; } return true; } @SuppressWarnings("unused") private  UrlUtil(); static boolean isValidURL(String url);  }