public static String relativeToAbsolute(String baseURL,String relativeURL){
  if (relativeURL.startsWith("/")) {
    return getURLProtocol(baseURL) + "://" + getURLHost(baseURL)+ relativeURL;
  }
 else {
    return getURLProtocol(baseURL) + "://" + getURLHost(baseURL)+ getURLBasePath(baseURL)+ relativeURL;
  }
}

public static String relativeToAbsolute ( String baseURL , String relativeURL ) { if ( relativeURL . startsWith ( "/" ) ) { return getURLProtocol ( baseURL ) + "://" + getURLHost ( baseURL ) + relativeURL ; } else { return getURLProtocol ( baseURL ) + "://" + getURLHost ( baseURL ) + getURLBasePath ( baseURL ) + relativeURL ; } }
converts a relative url e . g . : / myfile . html to an absolute url
