I have this URL:
String template = "https://{subdomain}.apache.com/t/information/{information_service}";
I would like to know how can I replace the values {subdomain} and {information_service} to build a new URL. Something like this
String subdomain = "newHouse";
String information_service = "rooms";
Note: I will get different values for each iteration and session, this is just an example
Output
String URL = "https://newHouse.apache.com/t/information/rooms";
I tried with this example
URIBuilder builder = new URIBuilder()
.setScheme("http")
.setHost("apache.org")
.setPath("/shindig")
.addParameter("helloWorld", "foo&bar")
.setFragment("foo");
builder.toString();
But I wonder if there are something more directly to replace the value of placeholders