Introduction
Urin is a URI generator and parser for Java. It is written to make the dynamic generation of URIs easier than it is with Java's built-in URI and URL classes, and to provide support for the current URI standard, RFC 3986. It is open source, and free for you to use.
The latest version of Urin available for download is 4.6. The javadoc is also available online.
Example
A brief example demonstrates the generation of an HTTP URI:
This produces the String
"http://www.example.com/music/AC%2FDC/Back%20in%20Black
". Note that the '/
' character in "AC/DC
" has been encoded as "%2F
", and that the space characters in "Back in Black
" have been encoded as "%20
".
In the above example, the registered name and path could be any Java String
s we choose; the library will encode them appropriately to the part of the URI where they appear.
It's equally easy to go back to the non-encoded version:
This produces a List
of three Segment
s, with the values "music
", "AC/DC
", and "Back in Black
".