Java URL is Absolute getAbsoluteUrl(String base_url, String rel_url)

Here you can find the source of getAbsoluteUrl(String base_url, String rel_url)

Description

get Absolute Url

License

Open Source License

Declaration

public static String getAbsoluteUrl(String base_url, String rel_url) throws MalformedURLException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    public static String getAbsoluteUrl(String base_url, String rel_url) throws MalformedURLException {
        URL base = new URL(base_url);
        URL abs = new URL(base, rel_url);
        return abs.toString();
    }//from w  w  w  .ja  v  a  2  s.c om
}

Related

  1. getAbsoluteURL(String baseUrl, String url)
  2. getAbsoluteURL(String baseURLString, String relURlString)
  3. getAbsoluteURL(String relativeURL, String baseURL)
  4. getAbsoluteURL(String url, URL base)