code: private static URI toFileSystemUri(URI uri) {
      try {
        return new URI(
            uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), null, null, null);
      } catch (URISyntaxException e) {
        throw new AssertionError(e);
      }
    }
docs: Returns the given URI with any path, query or fragment stripped off.