|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openqa.jetty.util.URI
public class URI
URI Holder. This class assists with the decoding and encoding or HTTP URI's. It differs from the java.net.URL class as it does not provide communications ability, but it does assist with query string formatting.
ISO_8859_1 encoding is used by default for % encoded characters. This may be overridden with the org.openqa.jetty.util.URI.charset system property.
UrlEncoded
Field Summary | |
---|---|
static String |
__CHARSET
|
static boolean |
__CHARSET_IS_DEFAULT
|
Constructor Summary | |
---|---|
URI(String uri)
Construct from a String. |
|
URI(URI uri)
Copy Constructor . |
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(Map values)
Add dictionary to the uri query _parameters. |
Object |
put(Object name,
Object value)
Add name value pair to the uri query _parameters. |
void |
put(String encoded)
Add encoded _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()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String __CHARSET
public static final boolean __CHARSET_IS_DEFAULT
Constructor Detail |
---|
public URI(URI uri) throws IllegalArgumentException
uri
-
IllegalArgumentException
public URI(String uri) throws IllegalArgumentException
uri
- [scheme://host[:port]]/path[?query]
IllegalArgumentException
Method Detail |
---|
public void setURI(String uri) throws IllegalArgumentException
IllegalArgumentException
public boolean isAbsolute()
public String getScheme()
public void setScheme(String scheme)
scheme
- the uri schemepublic String getHost()
public void setHost(String host)
host
- the uri hostpublic int getPort()
public void setPort(int port)
port
- the uri portpublic String getPath()
public String getEncodedPath()
public void setPath(String path)
path
- the URI pathpublic String getQuery()
public void setQuery(String query)
query
- the URI query stringpublic Set getParameterNames()
public MultiMap getParameters()
public Map getUnmodifiableParameters()
public void putParametersTo(MultiMap map)
public void clearParameters()
public void put(String encoded)
encoded
- A HTTP encoded string of _parameters: e.g.. "a=1&b=2"public Object put(Object name, Object value)
name
- name of valuevalue
- The value, which may be a multi valued list or
String array.public void put(Map values)
public String get(String name)
public List getValues(String name)
name
- The parameter name
public void remove(String name)
public String toString()
toString
in class Object
public static String encodePath(String path)
path
- The path the encode
public static StringBuffer encodePath(StringBuffer buf, String path)
path
- The path the encodebuf
- StringBuffer to encode path into (or null)
public static StringBuffer encodeString(StringBuffer buf, String path, String encode)
path
- The path the encodebuf
- StringBuffer to encode path into (or null)encode
- String of characters to encode. % is always encoded.
public static String decodePath(String path)
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public static String addPaths(String p1, String p2)
p1
- URI path segmentp2
- URI path segment
public static String parentPath(String p)
public static String stripPath(String path)
public static String canonicalPath(String path)
path
-
public static boolean hasScheme(String uri)
uri
- URI
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |