if (unauthenticated && sessionId != null) {
LOG.error("Both session() and unauthenticated() are set for this request, this is a bug, using session id.", new Throwable());
}
if (sessionId != null) {
// pass the current session id via basic auth and special "password"
uriBuilder.userInfo(sessionId + ":session");
}
builtUrl = uriBuilder.build();
return builtUrl.toURL();
} catch (MalformedURLException e) {
// TODO handle this properly