Trying to build http://IP:4567/foldername/1234?abc=xyz
. I don\'t know much about it but I wrote below code from searching from google:
import java.n
UriComponentsBuilder.newInstance()
.scheme(scheme)
.host(host)
.path(path)
.build()
.toUri()
.toURL();
A new UriComponentsBuilder class helps to create UriComponents instances by providing fine-grained control over all aspects of preparing a URI including construction, expansion from template variables, and encoding.
Know more: https://www.baeldung.com/spring-uricomponentsbuilder
JavaDoc: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/util/UriComponentsBuilder.html