public class EncodingUtil
extends java.lang.Object
| Constructor and Description |
|---|
EncodingUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.net.URI |
encodeURL(java.lang.String url)
Parses and returns an encoded version of the given URL string.
|
static java.lang.String |
encodeURLToString(java.lang.String url)
Parses and returns an encoded version of the given URL string.
|
static java.lang.String |
encodeURLToString(java.lang.String baseUrl,
java.lang.String... paths)
Parses and returns an encoded version of the given URL string alongside the given paths.
|
public static java.net.URI encodeURL(java.lang.String url)
throws java.net.MalformedURLException,
java.net.URISyntaxException
url - Raw/decoded string form of a URL to parse/encode.URI that represents the string form URL passed in.java.net.MalformedURLExceptionjava.net.URISyntaxExceptionpublic static java.lang.String encodeURLToString(java.lang.String url)
MalformedURLException and URISyntaxException in case the passed URL is invalid.url - Raw/decoded string form of a URL to parse/encode.java.lang.IllegalArgumentException - in case the URL string is invalid.public static java.lang.String encodeURLToString(java.lang.String baseUrl,
java.lang.String... paths)
baseUrl - Base URL to use when constructing the final URL, ie: scheme://authority/initial.path.paths - Additional path(s) to append at the end of the base path.