Class EncodingUtil
- java.lang.Object
-
- org.apache.maven.wagon.shared.http.EncodingUtil
-
public class EncodingUtil extends java.lang.ObjectEncoding utility.- Since:
- 2.7
-
-
Constructor Summary
Constructors Constructor Description EncodingUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.net.URIencodeURL(java.lang.String url)Parses and returns an encoded version of the given URL string.static java.lang.StringencodeURLToString(java.lang.String url)Parses and returns an encoded version of the given URL string.static java.lang.StringencodeURLToString(java.lang.String baseUrl, java.lang.String... paths)Parses and returns an encoded version of the given URL string alongside the given paths.
-
-
-
Method Detail
-
encodeURL
public static java.net.URI encodeURL(java.lang.String url) throws java.net.MalformedURLException, java.net.URISyntaxExceptionParses and returns an encoded version of the given URL string.- Parameters:
url- Raw/decoded string form of a URL to parse/encode.- Returns:
- Parsed/encoded
URIthat represents the string form URL passed in. - Throws:
java.net.MalformedURLExceptionjava.net.URISyntaxException
-
encodeURLToString
public static java.lang.String encodeURLToString(java.lang.String url)
Parses and returns an encoded version of the given URL string. Wraps theMalformedURLExceptionandURISyntaxExceptionin case the passed URL is invalid.- Parameters:
url- Raw/decoded string form of a URL to parse/encode.- Returns:
- Parsed/encoded URI (as string) that represents the
- Throws:
java.lang.IllegalArgumentException- in case the URL string is invalid.
-
encodeURLToString
public 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.- Parameters:
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.- Returns:
- Composed URL (base + paths) already encoded, separating the individual path components by "/".
- Since:
- TODO
-
-