code: public static URL getRootURL(VirtualFile file) throws MalformedURLException {
          final URI uri;
          try {
              uri = getRootURI(file);
          } catch (URISyntaxException e) {
              throw new MalformedURLException(e.getMessage());
          }
          return uri.toURL();
      }
docs: Get the physical root URL of the filesystem of a virtual file.  This URL is suitable for use as a class loader's
  code source or in similar situations where only standard URL types ({@code jar} and {@code file}) are supported.
  
  @param file the virtual file
  @return the root URL
  @throws MalformedURLException if the URL is not valid