Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.hp.hpl.jena.util
Class URIref

    java.lang.Object
      com.hp.hpl.jena.util.URIref

    public class URIref

extends java.lang.Object

This class provides methods to encode and decode URI References in accordance with http://www.w3.org/TR/charmod/#sec-URIs . The details of how the algorithms handle '%' are captured in http://lists.w3.org/Archives/Public/uri/2001Sep/0009.html

Author:
  jjc

Constructor Summary
`URIref()`

Method Summary
`static java.lang.String` | `decode(java.lang.String uri)` Convert a URI, in US-ASCII, with escaped characters taken from UTF-8, to the corresponding Unicode string.
`static java.lang.String` | `encode(java.lang.String unicode)` Convert a Unicode string, first to UTF-8 and then to an RFC 2396 compliant URI with optional fragment identifier using %NN escape mechanism as appropriate.
`static void` | `main(java.lang.String[] args)` For simple testing ...

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### URIref

    public URIref()

Method Detail

### encode

    public static java.lang.String encode(java.lang.String unicode)

  Convert a Unicode string, first to UTF-8 and then to an RFC 2396 compliant URI with optional fragment identifier using %NN escape mechanism as appropriate. The '%' character is assumed to already indicated an escape byte. The '%' character must be followed by two hexadecimal digits.

  Parameters:
    `unicode` - The uri, in characters specified by RFC 2396 + '#'
  Returns:
    The corresponding Unicode String

### decode

    public static java.lang.String decode(java.lang.String uri)

  Convert a URI, in US-ASCII, with escaped characters taken from UTF-8, to the corresponding Unicode string. On ill-formed input the results are undefined, specifically if the unescaped version is not a UTF-8 String, some String will be returned. Escaped '%' characters (i.e. "%25") are left unchanged.

  Parameters:
    `uri` - The uri, in characters specified by RFC 2396 + '#'.
  Returns:
    The corresponding Unicode String.
  Throws:
    `java.lang.IllegalArgumentException` - If a % hex sequence is ill-formed.

### main

    public static void main(java.lang.String[] args)

  For simple testing ...

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP