Here you can find the source of createUrlQuietly(Path path)
public static URL createUrlQuietly(Path path)
//package com.java2s; //License from project: Open Source License import java.net.MalformedURLException; import java.net.URL; import java.nio.file.Path; import java.nio.file.Paths; public class Main { public static URL createUrlQuietly(Path path) { try {/*from w ww. j a v a 2 s. com*/ return path.toUri().toURL(); } catch (MalformedURLException e) { throw new RuntimeException(e); } } public static URL createUrlQuietly(String path) { try { return Paths.get(path).toUri().toURL(); } catch (MalformedURLException e) { throw new RuntimeException(e); } } }