@Test(expected = IllegalStateOfArgumentException.class) public void build_invalid_url() throws Exception { UrlUtil.build("i'm invalid"); }
public static URL build(@Nonnull final String url) { Check.notNull(url, "url"); URL ret = null; try { ret = new URL(url); } catch (final MalformedURLException e) { throw new IllegalStateOfArgumentException("The given string is not a valid URL: " + url, e); } return ret; }
UrlUtil { public static URL build(@Nonnull final String url) { Check.notNull(url, "url"); URL ret = null; try { ret = new URL(url); } catch (final MalformedURLException e) { throw new IllegalStateOfArgumentException("The given string is not a valid URL: " + url, e); } return ret; } }
UrlUtil { public static URL build(@Nonnull final String url) { Check.notNull(url, "url"); URL ret = null; try { ret = new URL(url); } catch (final MalformedURLException e) { throw new IllegalStateOfArgumentException("The given string is not a valid URL: " + url, e); } return ret; } private  UrlUtil(); }
UrlUtil { public static URL build(@Nonnull final String url) { Check.notNull(url, "url"); URL ret = null; try { ret = new URL(url); } catch (final MalformedURLException e) { throw new IllegalStateOfArgumentException("The given string is not a valid URL: " + url, e); } return ret; } private  UrlUtil(); static URL build(@Nonnull final String url); static InputStream open(@Nonnull final URL url); static String read(@Nonnull final URL url, @Nonnull final Charset charset); static URL toUrl(@Nonnull final File file); }
UrlUtil { public static URL build(@Nonnull final String url) { Check.notNull(url, "url"); URL ret = null; try { ret = new URL(url); } catch (final MalformedURLException e) { throw new IllegalStateOfArgumentException("The given string is not a valid URL: " + url, e); } return ret; } private  UrlUtil(); static URL build(@Nonnull final String url); static InputStream open(@Nonnull final URL url); static String read(@Nonnull final URL url, @Nonnull final Charset charset); static URL toUrl(@Nonnull final File file);  }