An open API service indexing awesome lists of open source software.

https://github.com/tezc/url

URL parser
https://github.com/tezc/url

Last synced: 3 months ago
JSON representation

URL parser

Awesome Lists containing this project

README

        

# URL
URL parser for java without temporary string objects.

This is useful when you are required to parse lots of URL and decrease pressure on GC.
Parsed parts are presented as CharSequences.

```java
URL url = new URL("http://domain.com/some-path?user=jane&user=john#frag");

CharSequence scheme = url.getScheme();
if (scheme.equals("http")) {
System.out.println("Scheme is http");
}

Map items = url.getQueryItems();
URL.QueryItem values = items.get("user");
while (values != null) {
System.out.println("user : " + values.value);
values = values.next;
}
```