https://github.com/tezc/url
URL parser
https://github.com/tezc/url
Last synced: 3 months ago
JSON representation
URL parser
- Host: GitHub
- URL: https://github.com/tezc/url
- Owner: tezc
- Created: 2018-02-19T17:27:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-28T19:03:48.000Z (over 7 years ago)
- Last Synced: 2025-02-08T23:44:43.824Z (5 months ago)
- Language: Java
- Homepage:
- Size: 9.77 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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;
}
```