net.fortuna.ical4j.util
Class Uris

java.lang.Object
  extended by net.fortuna.ical4j.util.Uris

public final class Uris
extends java.lang.Object

Utility methods for working with URIs.

Author:
Ben Fortuna

Method Summary
static java.net.URI create(java.lang.String s)
          Attempts to create a URI instance and will optionally swallow any resulting URISyntaxException depending on configured CompatibilityHints.
static java.lang.String decode(java.lang.String s)
          Decodes the specified URI string using the UTF-8 charset.
static java.lang.String encode(java.lang.String s)
          Encodes the specified URI string using the UTF-8 charset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encode

public static java.lang.String encode(java.lang.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

decode

public static java.lang.String decode(java.lang.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

create

public static java.net.URI create(java.lang.String s)
                           throws java.net.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.
Throws:
java.net.URISyntaxException - if a valid URI string is not specified and relaxed parsing is disabled


Copyright © 2004-2007 Modularity. All Rights Reserved.