Here you can find the source of resolve(String host, String path)
private static URI resolve(String host, String path)
//package com.java2s; /****************************************************************************** * Copyright (c) 2012 Masatomi KINO and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * Contributors:/*from w ww . ja va 2 s. co m*/ * Masatomi KINO - initial API and implementation * $Id$ ******************************************************************************/ import java.net.URI; import java.net.URISyntaxException; public class Main { private static URI resolve(String host, String path) { URI uri = null; try { uri = new URI(host); uri = uri.resolve(path); } catch (URISyntaxException e) { e.printStackTrace(); return null; } return uri; } }