|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.client.util.escape.CharEscapers
public final class CharEscapers
Utility functions for dealing with CharEscaper
s, and some commonly used CharEscaper
instances.
Method Summary | |
---|---|
static String |
decodeUri(String uri)
Percent-decodes a US-ASCII string into a Unicode string. |
static String |
escapeUri(String value)
Escapes the string value so it can be safely included in URIs. |
static String |
escapeUriPath(String value)
Escapes the string value so it can be safely included in URI path segments. |
static String |
escapeUriQuery(String value)
Escapes the string value so it can be safely included in URI query string segments. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String escapeUri(String value)
When encoding a String, the following rules apply:
Note: Unlike other escapers, URI escapers produce uppercase hexadecimal sequences. From
RFC 3986:
"URI producers and
normalizers should use uppercase hexadecimal digits for all percent-encodings."
This escaper has identical behavior to (but is potentially much faster than):
URLEncoder.encode(String, String)
with the encoding name "UTF-8"
public static String decodeUri(String uri)
This replaces each occurrence of '+' with a space, ' '. So this method should not be used for non application/x-www-form-urlencoded strings such as host and path.
uri
- a percent-encoded US-ASCII string
public static String escapeUriPath(String value)
When encoding a String, the following rules apply:
Note: Unlike other escapers, URI escapers produce uppercase hexadecimal sequences. From
RFC 3986:
"URI producers and
normalizers should use uppercase hexadecimal digits for all percent-encodings."
public static String escapeUriQuery(String value)
This escaper is also suitable for escaping fragment identifiers.
For details on escaping URIs, see section 2.4 of RFC 3986.
When encoding a String, the following rules apply:
Note: Unlike other escapers, URI escapers produce uppercase hexadecimal sequences. From
RFC 3986:
"URI producers and
normalizers should use uppercase hexadecimal digits for all percent-encodings."
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |