|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.xquery.util.URIUtils
Utilities for URI related functions
Constructor Summary | |
URIUtils()
|
Method Summary | |
static java.lang.String |
encodeForURI(java.lang.String uriPart)
|
static XmldbURI |
encodeXmldbUriFor(java.lang.String path)
This method creates an XmldbURI by encoding the provided
string, then calling XmldbURI.xmldbUriFor(String) with the result of that
encoding |
static java.lang.String |
ensureUrlEncodedUtf8(java.lang.String path)
This method ensure that a collection path (e.g. |
static java.lang.String |
escapeHtmlURI(java.lang.String uri)
|
static java.lang.String |
iriToURI(java.lang.String uriPart)
|
static java.lang.String |
urlDecodeUtf8(java.lang.String uri)
This method decodes the provided uri for human readability. |
static java.lang.String |
urlDecodeUtf8(XmldbURI uri)
This method decodes the provided uri for human readability. |
static java.lang.String |
urlEncodePartsUtf8(java.lang.String url)
This method splits the supplied url on the character '/' then URL encodes the segments between, returning a URL encoded version of the passed url, leaving any occurrence of '/' as it is. |
static java.lang.String |
urlEncodeUtf8(java.lang.String uri)
This method is a wrapper for URLEncoder.encode(java.lang.String,java.lang.String)
It calls this method, suppying the url parameter as
the first parameter, and "UTF-8" (the W3C recommended
encoding) as the second. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public URIUtils()
Method Detail |
public static java.lang.String encodeForURI(java.lang.String uriPart)
public static java.lang.String iriToURI(java.lang.String uriPart)
public static java.lang.String escapeHtmlURI(java.lang.String uri)
public static java.lang.String urlEncodeUtf8(java.lang.String uri)
URLEncoder.encode(java.lang.String,java.lang.String)
It calls this method, suppying the url parameter as
the first parameter, and "UTF-8" (the W3C recommended
encoding) as the second. UnsupportedEncodingExceptions
are wrapped in a runtime exception.
IMPORTANT: the java.net.URLEncoder class encodes a space (" ")
as a "+". The proper method of encoding spaces in the path of
a URI is with "%20", so this method will replace all instances of "+"
in the encoded string with "%20" before returning. This means that
XmldbURIs constructed from java.net.URLEncoder#encoded strings
will not be String equivalents of XmldbURIs created with the result of
calls to this function.
uri
- The uri to encode
public static java.lang.String urlDecodeUtf8(java.lang.String uri)
uri
- The uri to decode
public static java.lang.String urlDecodeUtf8(XmldbURI uri)
uri
- The uri to decode
public static java.lang.String urlEncodePartsUtf8(java.lang.String url)
url
- The path to encode
public static java.lang.String ensureUrlEncodedUtf8(java.lang.String path)
path
- The path to check
public static XmldbURI encodeXmldbUriFor(java.lang.String path) throws java.net.URISyntaxException
XmldbURI
by encoding the provided
string, then calling XmldbURI.xmldbUriFor(String) with the result of that
encoding
path
- The path to encode and create an XmldbURI from
java.net.URISyntaxException
- A URISyntaxException is thrown if the path
cannot be parsed by XmldbURI, after being encoded by
urlEncodePartsUtf8
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |