Class Url
- java.lang.Object
-
- com.google.gerrit.extensions.restapi.Url
-
public final class Url extends Object
URL related utility functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
decode(String str)
Decode a URL encoded string, e.g.static String
encode(String component)
Encode a path segment, escaping characters not valid for a URL.
-
-
-
Method Detail
-
encode
public static String encode(String component)
Encode a path segment, escaping characters not valid for a URL.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.
- Parameters:
component
- a string containing text to encode.- Returns:
- a string with all invalid URL characters escaped.
-
-