org.mortbay.util
public class URI extends Object implements Cloneable
ISO_8859_1 encoding is used by default for % encoded characters. This may be overridden with the org.mortbay.util.URI.charset system property.
Version: $Id: URI.java,v 1.39 2006/01/04 13:55:31 gregwilkins Exp $
See Also: UrlEncoded
Field Summary | |
---|---|
static String | __CHARSET |
static boolean | __CHARSET_IS_DEFAULT |
Constructor Summary | |
---|---|
URI(URI uri) Copy Constructor . | |
URI(String uri) Construct from a String.
|
Method Summary | |
---|---|
static String | addPaths(String p1, String p2) Add two URI path segments.
|
static String | canonicalPath(String path) Convert a path to a cananonical form.
|
void | clearParameters() Clear the URI _parameters. |
Object | clone() Clone URI. |
static String | decodePath(String path) |
static String | encodePath(String path) Encode a URI path.
|
static StringBuffer | encodePath(StringBuffer buf, String path) Encode a URI path. |
static StringBuffer | encodeString(StringBuffer buf, String path, String encode) Encode a URI path. |
String | get(String name) Get named value |
String | getEncodedPath() Get the encoded uri path. |
String | getHost() Get the uri host. |
Set | getParameterNames() Get the uri query _parameters names. |
MultiMap | getParameters() Get the uri query _parameters. |
String | getPath() Get the uri path. |
int | getPort() Get the uri port. |
String | getQuery() Get the uri query String. |
String | getScheme() Get the uri scheme. |
Map | getUnmodifiableParameters() Get the uri query _parameters. |
List | getValues(String name) Get named multiple values. |
static boolean | hasScheme(String uri) |
boolean | isAbsolute() Is the URI an absolute URL? |
static String | parentPath(String p) Return the parent Path.
|
void | put(String encoded) Add encoded _parameters. |
Object | put(Object name, Object value) Add name value pair to the uri query _parameters. |
void | put(Map values) Add dictionary to the uri query _parameters. |
void | putParametersTo(MultiMap map) Add the uri query _parameters to a MultiMap |
void | remove(String name) Remove named value |
void | setHost(String host) Set the uri host. |
void | setPath(String path) Set the uri path. |
void | setPort(int port) Set the uri port.
|
void | setQuery(String query) Set the uri query String. |
void | setScheme(String scheme) Set the uri scheme. |
void | setURI(String uri) |
static String | stripPath(String path) Strip parameters from a path.
|
String | toString() |
Parameters: uri
Parameters: uri [scheme://host[:port]]/path[?query]
Parameters: p1 URI path segment p2 URI path segment
Returns: Legally combined path segments.
Parameters: path
Returns: path or null.
Returns: cloned URI
Parameters: path The path the encode
Returns: The encoded path
Parameters: path The path the encode buf StringBuffer to encode path into (or null)
Returns: The StringBuffer or null if no substitutions required.
Parameters: path The path the encode buf StringBuffer to encode path into (or null) encode String of characters to encode. % is always encoded.
Returns: The StringBuffer or null if no substitutions required.
Returns: the URI path
Returns: the URI host
Returns: Unmodifiable set of URI query _parameters names
Returns: the URI query _parameters
Returns: the URI path
Returns: the URI port
Returns: the URI query string
Returns: the URI scheme
Returns: the URI query _parameters in an unmodifiable map.
Parameters: name The parameter name
Returns: Umodifiable list of values or null
Parameters: uri URI
Returns: True if the uri has a scheme
Returns: True if the URI has a scheme or host
Parameters: encoded A HTTP encoded string of _parameters: e.g.. "a=1&b=2"
Parameters: name name of value value The value, which may be a multi valued list or String array.
Parameters: host the uri host
Parameters: path the URI path
Parameters: port the uri port
Parameters: query the URI query string
Parameters: scheme the uri scheme
Returns: the URI string encoded.