title: GWT replacement for java.net.URL
body: <p>I have to replace the protocol part of a already existing url in GWT. The <code>java.net</code> package has a class which was build for exactly that purpose: <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/net/URL.html" rel="noreferrer">URL</a>. Sadly GWT <a href="http://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html" rel="noreferrer">does not emulate the java.net package</a>.</p>
  
  <p>How can I reassemble a url in GWT without creating my own parser? (I know about <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/http/client/UrlBuilder.html" rel="noreferrer">UrlBuilder</a>, but UrlBuilder won't take an existing URL)</p>
  
  <p>Example: I have a url in a string "<a href="http://myserver.com/somepath/file.html?param" rel="noreferrer">http://myserver.com/somepath/file.html?param</a>" and I want to replace the protocol part with "https".</p>