code: public static URI getVirtualURI(VirtualFile file) throws URISyntaxException {
          return new URI(VFS_PROTOCOL, "", file.getPathName(true), null);
      }
docs: Get the virtual URI for a virtual file.
  <b>Note:</b> if the given VirtualFile refers to a directory <b>at the time of this
  method invocation</b>, a trailing slash will be appended to the URI; this means that invoking
  this method may require a filesystem access, and in addition, may not produce consistent results
  over time.
  
  @param file the virtual file
  @return the URI
  @throws URISyntaxException if the file cannot be coerced into a URI for some reason
  @see VirtualFile#asDirectoryURI()
  @see VirtualFile#asFileURI()