@Test public void toUrl_empty() { final URL url = UrlUtil.toUrl(new File("doesn't exist")); assertThat(url).isNotNull(); }
public static URL toUrl(@Nonnull final File file) { Check.notNull(file, "file"); URL url = null; try { url = file.toURI().toURL(); } catch (final MalformedURLException e) { throw new IllegalStateException("Can not construct an URL for passed file.", e); } return url; }
UrlUtil { public static URL toUrl(@Nonnull final File file) { Check.notNull(file, "file"); URL url = null; try { url = file.toURI().toURL(); } catch (final MalformedURLException e) { throw new IllegalStateException("Can not construct an URL for passed file.", e); } return url; } }
UrlUtil { public static URL toUrl(@Nonnull final File file) { Check.notNull(file, "file"); URL url = null; try { url = file.toURI().toURL(); } catch (final MalformedURLException e) { throw new IllegalStateException("Can not construct an URL for passed file.", e); } return url; } private  UrlUtil(); }
UrlUtil { public static URL toUrl(@Nonnull final File file) { Check.notNull(file, "file"); URL url = null; try { url = file.toURI().toURL(); } catch (final MalformedURLException e) { throw new IllegalStateException("Can not construct an URL for passed file.", e); } return url; } 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 toUrl(@Nonnull final File file) { Check.notNull(file, "file"); URL url = null; try { url = file.toURI().toURL(); } catch (final MalformedURLException e) { throw new IllegalStateException("Can not construct an URL for passed file.", e); } return url; } 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);  }