Here you can find the source of getUri(String baseApiUrl, String path)
Parameter | Description |
---|---|
path | a parameter |
Parameter | Description |
---|---|
URISyntaxException | an exception |
protected static URI getUri(String baseApiUrl, String path) throws URISyntaxException
//package com.java2s; import java.net.URI; import java.net.URISyntaxException; public class Main { /**/* w ww . j av a 2 s.c o m*/ * Gets the absolute URL to use to invoke a rest API at a given path. * * @param path * @throws URISyntaxException */ protected static URI getUri(String baseApiUrl, String path) throws URISyntaxException { if (baseApiUrl.endsWith("/")) { baseApiUrl = baseApiUrl.substring(0, baseApiUrl.length() - 1); } if (path == null) { return new URI(baseApiUrl); } else { return new URI(baseApiUrl + path); } } }