Skip to content

BastiaanJansen/uri-builder-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URIBuilder-Java

A utility Java library to easily create and parse URI's.

Installation

Maven

<dependency>
    <groupId>com.github.bastiaanjansen</groupId>
    <artifactId>uribuilder-java</artifactId>
    <version>1.0.1</version>
</dependency>

Gradle

implementation 'com.github.bastiaanjansen:uribuilder-java:1.0.1'

Usage

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");