org.semanticdesktop.aperture.util
Class UriUtil

java.lang.Object
  extended by org.semanticdesktop.aperture.util.UriUtil

public final class UriUtil
extends Object

Methods related to actions on URIs. The definition of a URI is taken from RFC 2396: URI Generic Syntax.


Constructor Summary
UriUtil()
           
 
Method Summary
static String decodeUri(String uri)
          Decodes a string according to RFC 2396.
static void decodeUri(String uri, StringBuilder buffer)
          Decodes a string according to RFC 2396.
static String encodeUri(String uri)
          Encodes a string according to RFC 2396.
static void encodeUri(String uri, StringBuilder buffer)
          Encodes a string according to RFC 2396.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UriUtil

public UriUtil()
Method Detail

encodeUri

public static String encodeUri(String uri)
Encodes a string according to RFC 2396. According to this spec, any characters outside the range 0x20 - 0x7E must be escaped because they are not printable characters, except for characters in the fragment identifier. Even within this range a number of characters must be escaped. This method will perform this escaping.

Parameters:
uri - The URI to encode.
Returns:
The encoded URI.

encodeUri

public static void encodeUri(String uri,
                             StringBuilder buffer)
Encodes a string according to RFC 2396.

Parameters:
uri - The URI to encode.
buffer - The StringBuilder that the encoded URI will be appended to.
See Also:
encodeUri(java.lang.String)

decodeUri

public static String decodeUri(String uri)
Decodes a string according to RFC 2396. According to this spec, any characters outside the range 0x20 - 0x7E must be escaped because they are not printable characters, except for any characters in the fragment identifier. This method will translate any escaped characters back to the original.

Parameters:
uri - The URI to decode.
Returns:
The decoded URI.

decodeUri

public static void decodeUri(String uri,
                             StringBuilder buffer)
Decodes a string according to RFC 2396.

Parameters:
uri - The URI to decode.
buffer - The StringBuilder that the decoded URI will be appended to.
See Also:
decodeUri(java.lang.String)


Copyright © 2010 Aperture Development Team. All Rights Reserved.