Skip to content

agustisanchez/urlbuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UrlBuilder

A simple Java API to build URL strings with a fluid syntax and zero dependencies.

Features

  • fluid syntax
  • query parameters automatically encoded with URLEncode and UTF8
  • recognizes the following elements of URL spec: schema, authorization, host, port, path, query parameter, fragment
  • supports parameter without value
  • supports starting with a base URI
  • supports returning an schema relative URL

Examples

Simple usage

   String url = new UrlBuilder("http://foo.net")
                        .path("test")
                        .param("simpleParam", "1/2")
                        .param("multiValueParam", "first", "second")
                        .param("noValueParam")
                        .fragment("fragment")
                        .build();

returns:

   http://foo.net/test?simpleParam=1%2F2&multiValueParam=first&multiValueParam=second&noValueParam#fragment

About

A simple Java Api to build Url strings

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages