Urllib is a library that makes URL manipulation easy, fun, and safe!
System.out.println(
Url.http("maps.google.com")
.path("maps")
.query("q", "Búðardalur")
.create());
>> http://maps.google.com/maps?q=B%C3%BA%C3%B0ardalur
System.out.println(
Url.parse("https://www.wolframalpha.com/input/?i=%E2%88%9A-1")
.query()
.params());
>> {i=√-1}
Feel free to check out the code and give feedback! The first stable release will be 1.0. In the meantime, builds are available on jitpack:
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
compile 'org.urllib:urllib:master-SNAPSHOT'
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.urllib</groupId>
<artifactId>urllib</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
</dependencies>
Url
from scratch with builders.java.net.URI
Url
object.Url
by parsing.java.net.URI
from a previously-encoded URL
.Url
Url
to display to users (like in a web browser URL bar)