Here you can find the source of resolveRelativeURI(URI base, String rel)
private static String resolveRelativeURI(URI base, String rel)
//package com.java2s; //License from project: Apache License import java.net.URI; public class Main { private static String resolveRelativeURI(URI base, String rel) { if (base.getFragment() != null) { return base + rel; }/* w w w . j av a 2s .c om*/ return base.resolve(rel).toString(); } }