title: Java URI.resolve
body: <p>I'm trying to resolve two URIs, but it's not as straightforward as I'd like it to be.</p>
  
  <pre><code>URI a = new URI("http://www.foo.com");
  URI b = new URI("bar.html");
  </code></pre>
  
  <p>The trouble is that <code>a.resolve(b).toString()</code> is now <code>"http://www.foo.combar.html"</code>. How can I get away with that?</p>