final URI spliceUrl(String resource, Map<String, String> parameters) throws RestEndpointIOException {
        try {
            URIBuilder builder;
            if (!Strings.isNullOrEmpty(baseUrl)) {
                builder = new URIBuilder(baseUrl);
                builder.setPath(builder.getPath() + resource);
            } else {
                builder = new URIBuilder(resource);
            }
            for (Entry<String, String> parameter : parameters.entrySet()) {
                builder.addParameter(parameter.getKey(), parameter.getValue());
            }
            return builder.build();
        } catch (URISyntaxException e) {
            throw new RestEndpointIOException(
                    "Unable to builder URL with base url '" + baseUrl + "' and resouce '" + resource + "'", e);
        }
    }
final URI spliceUrl ( String resource , Map < String , String > parameters ) throws RestEndpointIOException { try { URIBuilder builder ; if ( ! Strings . isNullOrEmpty ( baseUrl ) ) { builder = new URIBuilder ( baseUrl ) ; builder . setPath ( builder . getPath ( ) + resource ) ; } else { builder = new URIBuilder ( resource ) ; } for ( Entry < String , String > parameter : parameters . entrySet ( ) ) { builder . addParameter ( parameter . getKey ( ) , parameter . getValue ( ) ) ; } return builder . build ( ) ; } catch ( URISyntaxException e ) { throw new RestEndpointIOException ( "Unable to builder URL with base url '" + baseUrl + "' and resouce '" + resource + "'" , e ) ; } }
Splice base URL and URL of resource

@param resource   REST Resource Path
@param parameters Map of query parameters
@return Absolute URL to the REST Resource including server and port
@throws RestEndpointIOException In case of incorrect URL format