Here you can find the source of checkUrl(URL url, URL baseUrl)
static void checkUrl(URL url, URL baseUrl)
//package com.java2s; //License from project: Apache License import java.net.URL; public class Main { static void checkUrl(URL url, URL baseUrl) { // Is there a better test to use here? if (baseUrl.getHost() == null) { throw new RuntimeException("base URL is null"); }//from w w w. jav a2 s . c o m if (!baseUrl.getHost().equalsIgnoreCase(url.getHost())) { throw new RuntimeException("Domain of URL " + url + " doesn't match base URL " + baseUrl); } } }