public class EncodingUtil extends Object
Constructor and Description |
---|
EncodingUtil() |
Modifier and Type | Method and Description |
---|---|
static URI |
encodeURL(String url)
Parses and returns an encoded version of the given URL string.
|
static String |
encodeURLToString(String url)
Parses and returns an encoded version of the given URL string.
|
static String |
encodeURLToString(String baseUrl,
String... paths)
Parses and returns an encoded version of the given URL string alongside the given paths.
|
public EncodingUtil()
public static URI encodeURL(String url) throws MalformedURLException, URISyntaxException
url
- Raw/decoded string form of a URL to parse/encode.URI
that represents the string form URL passed in.MalformedURLException
URISyntaxException
public static String encodeURLToString(String url)
MalformedURLException
and URISyntaxException
in case the passed URL is invalid.url
- Raw/decoded string form of a URL to parse/encode.IllegalArgumentException
- in case the URL string is invalid.public static String encodeURLToString(String baseUrl, 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.Copyright © 2003–2015 The Apache Software Foundation. All rights reserved.