KEYCLOAK-8162 review comment adopted

This commit is contained in:
Vidhyadharan Deivamani 2019-11-21 18:00:09 +05:30 committed by Stian Thorgersen
parent 318b290f55
commit 9e366f0453

View file

@ -94,7 +94,7 @@ public class UrlBean {
}
public String getResourcesUrl() {
return getHostPortScheme(baseURI)+ getResourcesPath();
return Urls.themeRoot(baseURI).toString() + "/" + theme.getType().toString().toLowerCase() +"/" + theme.getName();
}
public String getOauthAction() {
@ -109,31 +109,4 @@ public class UrlBean {
URI uri = Urls.themeRoot(baseURI);
return uri.getPath() + "/" + theme.getType().toString().toLowerCase() +"/" + theme.getName();
}
private String getHostPortScheme(URI baseUri) {
StringBuilder hostPostScheme = new StringBuilder("");
String scheme = baseUri.getScheme();
int port = baseUri.getPort();
String host = baseUri.getHost();
if (scheme == null) {
scheme = "http";
}
hostPostScheme
.append(scheme)
.append("://");
if (host == null) {
host = "localhost";
}
hostPostScheme.append(host);
if (port != -1) {
hostPostScheme.append(":")
.append(port);
}
return hostPostScheme.toString();
}
}