A utility Java library to easily create and parse URI's.
<dependency>
<groupId>com.github.bastiaanjansen</groupId>
<artifactId>uribuilder-java</artifactId>
<version>1.0.1</version>
</dependency>
implementation 'com.github.bastiaanjansen:uribuilder-java:1.0.1'
To create a URI:
URI uri = new URIBuilder()
.withScheme("https")
.withAuthority("authority.com")
.withPath("/path")
.withQueryParamater("key", "value")
.withFragment("fragment")
.build();
To parse a URI string to a URI instance:
URI uri = URIBuilder.parse("https://authority.com/path?key=value#fragment");