Java Host Resolve resolve(String host, String path)

Here you can find the source of resolve(String host, String path)

Description

resolve

License

Open Source License

Declaration

private static URI resolve(String host, String path) 

Method Source Code

//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;
    }
}

Related

  1. resolveHost(String hostname)
  2. resolveHostname()
  3. resolveHostname()
  4. resolveHostName()