return URI.create(baseAddress);
} catch (RuntimeException ex) {
// no need to check "https" scheme or indeed ':'
// as the relative address will not work as the base address
if (baseAddress.startsWith(HTTP_SCHEME)) {
return new UriBuilderImpl().uriAsTemplate(baseAddress).build();
} else {
throw ex;
}
}
}