{"id":21817784,"url":"https://github.com/yescallop/fluent-uri","last_synced_at":"2026-03-05T00:33:04.097Z","repository":{"id":122962951,"uuid":"237221842","full_name":"yescallop/fluent-uri","owner":"yescallop","description":"An RFC 3986 compliant fluent-designed Java library for URI parsing, building, resolving and normalizing.","archived":false,"fork":false,"pushed_at":"2020-02-26T07:41:31.000Z","size":63,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-27T15:51:03.782Z","etag":null,"topics":["builder","fluent-api","normalization","parser","resolution","rfc-3986","uri"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yescallop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-30T13:44:38.000Z","updated_at":"2023-06-05T06:32:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"296dbe48-d75f-46ee-aa63-2b9409043261","html_url":"https://github.com/yescallop/fluent-uri","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yescallop%2Ffluent-uri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yescallop%2Ffluent-uri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yescallop%2Ffluent-uri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yescallop%2Ffluent-uri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yescallop","download_url":"https://codeload.github.com/yescallop/fluent-uri/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235674092,"owners_count":19027520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["builder","fluent-api","normalization","parser","resolution","rfc-3986","uri"],"created_at":"2024-11-27T15:48:24.211Z","updated_at":"2025-10-08T02:32:01.580Z","avatar_url":"https://github.com/yescallop.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fluent-uri\n\nfluent-uri is an [RFC 3986](https://www.ietf.org/rfc/rfc3986.html) compliant fluent-designed Java library for URI parsing, building, resolving and normalizing.\n\nThis project is still under development, contributions are welcome.\n\n![Java CI](https://github.com/yescallop/uriutils/workflows/Java%20CI/badge.svg)\n\n## Features\n - Strict syntax validating\n - Immutable URI references presented as **Uri** instances\n - Mutable builders which can be created from **Uri** instances\n - Building **Uri**s with raw / encoded components, path segments and query parameters\n - Supporting IDNA encoding ([RFC 3490](https://www.ietf.org/rfc/rfc3490.html)) and DNS syntax checking for host component\n - Supporting IPv6 scoped addresses ([RFC 6874](https://www.ietf.org/rfc/rfc6874.html))\n - Reference resolution ([Section 5](https://www.ietf.org/rfc/rfc3986.html#section-5))\n - Path normalization ([Section 5.2.4](https://www.ietf.org/rfc/rfc3986.html#section-5.2.4))\n - Utilities for percent en/decoding ([Section 2.1](https://www.ietf.org/rfc/rfc3986.html#section-2.1))\n\n## Attention\n - URI components are not decoded until getters for decoded components are called.\n - Path component is always present, thus never `null`,\n while, if not present, port and the other components could be `-1` or `null`.\n - Occurrence of encoded slash \"**%2F**\" in the path is permitted, but literally decoded as \"**/**\" in `Uri#path()`,\n while `Uri#pathSegments()` handles it correctly.\n\n## Examples\n\n### Parsing\nHierarchical example:\n```java\nUri u = Uri.from(\"http://u%40@xn--h28h.com:80/fo%20o//bar/?k=v+1\u0026k=v%262\u0026k2\u0026=#%23\");\nu.scheme(); // 'http'\nu.encodedUserInfo(); // 'u%40'\nu.userInfo(); // 'u@'\nu.encodedHost(); // 'xn--h28h.com'\nu.host(); // '😃.com'\nu.port(); // 80\nu.encodedPath(); // '/fo%20o//bar/'\nu.path(); // '/fo o//bar/'\nu.pathSegments(); // {'fo o', '', 'bar', ''}\nu.encodedQuery(); // 'k=v+1\u0026k=v%262\u0026k2\u0026='\nu.queryParameters(); // {'k'={'v 1', 'v\u00262'}, 'k2'={null}, ''={''}}\nu.encodedFragment(); // '%23'\nu.fragment(); // '#'\n```\nOpaque example:\n```java\nUri u = Uri.from(\"mailto:user@example.com?subject=test\u0026body=parse\");\nu.scheme(); // 'mailto'\nu.encodedUserInfo(); u.userInfo(); u.encodedHost(); u.host(); // null\nu.port(); // -1\nu.encodedPath(); u.path(); // 'user@example.com'\nu.encodedQuery(); // 'subject=test\u0026body=parse'\nu.queryParameters(); // {'subject'={'test'}, 'body'={'parse'}}\nu.encodedFragment(); u.fragment(); // null\n```\n### Building\n```java\nUri.newBuilder()\n    .scheme(\"http\")\n    .encodedUserInfo(\"u%40\")\n    .host(\"😃.com\").port(80)\n    .path(\"/fo o\")\n    .appendPathSegment(\"\")\n    .appendPathSegment(\"\")\n    .appendPathSegment(\"bar\")\n    .appendPathSegment(\"\")\n    .encodedQuery(\"k=v+1\")\n    .appendQueryParameter(\"k\", \"v\u00262\")\n    .appendQueryParameter(\"k2\", null)\n    .appendQueryParameter(\"\", \"\")\n    .fragment(\"#\").build();\n// 'http://u%40@xn--h28h.com:80/fo%20o//bar/?k=v+1\u0026k=v%262\u0026k2\u0026=#%23'\n```\n\n### Resolving\n```java\nUri u = Uri.from(\"http://a/b/c/d;p?q#r\");\nu.resolve(\"g\"); // 'http://a/b/c/g'\nu.resolve(\"../g\"); // 'http://a/b/g'\nu.resolve(\".\"); // 'http://a/b/c/'\nu.resolve(\"/\"); // 'http://a/'\n```\n\n### Normalizing\n```java\nUri.from(\"a/b/../../\").normalize(); // '.'\nUri.from(\"a/./../b/./c/d/..\").normalize(); // 'b/c/'\nUri.from(\"http://a/b/c/../d\").normalize(); // 'http://a/b/d'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyescallop%2Ffluent-uri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyescallop%2Ffluent-uri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyescallop%2Ffluent-uri/lists"}