public final class Url
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decode(java.lang.String str)
Decode a URL encoded string, e.g.
|
static java.lang.String |
encode(java.lang.String component)
Encode a path segment, escaping characters not valid for a URL.
|
public static java.lang.String encode(java.lang.String component)
The following characters are not escaped:
a..z, A..Z, 0..9
. - * _
' ' (space) is encoded as '+'.
All other characters (including '/') are converted to the triplet "%xy" where "xy" is the hex representation of the character in UTF-8.
component
- a string containing text to encode.public static java.lang.String decode(java.lang.String str)
"%2F"
to "/"
.