UrlUtil { public static String constructAbsoluteUrl(String theBase, String theEndpoint) { if (theEndpoint == null) { return null; } if (isAbsolute(theEndpoint)) { return theEndpoint; } if (theBase == null) { return theEndpoint; } try { return new URL(new URL(theBase), theEndpoint).toString(); } catch (MalformedURLException e) { ourLog.warn("Failed to resolve relative URL[" + theEndpoint + "] against absolute base[" + theBase + "]", e); return theEndpoint; } }  static String constructAbsoluteUrl(String theBase, String theEndpoint); static boolean isAbsolute(String theValue); static String constructRelativeUrl(String theParentExtensionUrl, String theExtensionUrl); static boolean isValid(String theUrl); static String unescape(String theString);  }
@Test public void testConstructAbsoluteUrl() { assertEquals("http: assertEquals("http: assertEquals("http: assertEquals("http: assertEquals("http: assertEquals("http: }