private static URI toUri(URL url) throws IOException {
    try {
      return url.toURI();
    } catch (URISyntaxException e) {
      throw new IOException("URL " + url + " cannot be converted to a URI", e);
    }
  }
{@code URLConnection} implementation.

@author Colin Decker
jimfs/src/main/java/com/google/common/jimfs/PathURLConnection.java