Here you can find the source of createURI(final String scheme, final String host, final int port)
public static URI createURI(final String scheme, final String host, final int port)
//package com.java2s; //License from project: Apache License import java.net.URI; import java.net.URISyntaxException; public class Main { public static URI createURI(final String scheme, final String host, final int port) { return createURIWithFull(scheme, null, host, port, null, null, null); }/*www . j a va 2 s . co m*/ public static URI createURIWithFull(final String scheme, final String userInfo, final String host, final int port, final String path, final String query, final String fragment) { try { return new URI(scheme, userInfo, host, port, path, query, fragment); } catch (URISyntaxException e) { throw new IllegalStateException("Unable to create URI", e); } } }