net.fortuna.ical4j.util

Class Uris


public final class Uris
extends java.lang.Object

$Id: Uris.java,v 1.5 2008/12/16 12:34:53 fortuna Exp $ Created on 11/09/2005 Utility methods for working with URIs.

Method Summary

static URI
create(String s)
Attempts to create a URI instance and will optionally swallow any resulting URISyntaxException depending on configured CompatibilityHints.
static String
decode(String s)
Decodes the specified URI string using the UTF-8 charset.
static String
encode(String s)
Encodes the specified URI string using the UTF-8 charset.

Method Details

create

public static URI create(String s)
            throws URISyntaxException
Attempts to create a URI instance and will optionally swallow any resulting URISyntaxException depending on configured CompatibilityHints. Will also automatically attempt encoding of the string representation for greater compatibility.
Parameters:
s - a string representation of a URI.
Returns:
a URI instance, or null if a valid URI string is not specified and relaxed parsing is enabled.

decode

public static String decode(String s)
Decodes the specified URI string using the UTF-8 charset. In the event that an exception is thrown, the specifed URI string is returned unmodified.
Parameters:
s - a URI string
Returns:
an encoded URI string

encode

public static String encode(String s)
Encodes the specified URI string using the UTF-8 charset. In the event that an exception is thrown, the specifed URI string is returned unmodified.
Parameters:
s - a URI string
Returns:
an encoded URI string