public static @NotNull String convertFromUrl(@NotNull URL url) {
    String protocol = url.getProtocol();
    String path = url.getPath();
    if (protocol.equals(URLUtil.JAR_PROTOCOL)) {
      if (StringUtil.startsWithConcatenation(path, URLUtil.FILE_PROTOCOL, PROTOCOL_DELIMITER)) {
        try {
          URL subURL = new URL(path);
          path = subURL.getPath();
        }
        catch (MalformedURLException e) {
          throw new RuntimeException(CoreBundle.message("url.parse.unhandled.exception"), e);
        }
      }
      else {
        throw new RuntimeException(new IOException(CoreBundle.message("url.parse.error", url.toExternalForm())));
      }
    }
    if (SystemInfoRt.isWindows) {
      while (!path.isEmpty() && path.charAt(0) == '/') {
        path = path.substring(1);
      }
    }

    path = URLUtil.unescapePercentSequences(path);
    return protocol + "://" + path;
  }
public static @NotNull String convertFromUrl(@NotNull URL url)