|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.xquery.util.URIUtils
public class URIUtils
Utilities for URI related functions
Constructor Summary | |
---|---|
URIUtils()
|
Method Summary | |
---|---|
static String |
encodeForURI(String uriPart)
|
static XmldbURI |
encodeXmldbUriFor(String path)
This method creates an XmldbURI by encoding the provided
string, then calling XmldbURI.xmldbUriFor(String) with the result of that
encoding |
static String |
ensureUrlEncodedUtf8(String path)
This method ensure that a collection path (e.g. |
static String |
escapeHtmlURI(String uri)
|
static String |
iriToURI(String uriPart)
|
static String |
urlDecodeUtf8(String uri)
This method decodes the provided uri for human readability. |
static String |
urlDecodeUtf8(XmldbURI uri)
This method decodes the provided uri for human readability. |
static String |
urlEncodePartsUtf8(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 String |
urlEncodeUtf8(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 String encodeForURI(String uriPart)
public static String iriToURI(String uriPart)
public static String escapeHtmlURI(String uri)
public static String urlEncodeUtf8(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 String urlDecodeUtf8(String uri)
uri
- The uri to decode
public static String urlDecodeUtf8(XmldbURI uri)
uri
- The uri to decode
public static String urlEncodePartsUtf8(String url)
url
- The path to encode
public static String ensureUrlEncodedUtf8(String path)
path
- The path to check
public static XmldbURI encodeXmldbUriFor(String path) throws 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
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 |