There are two types of encode methods:
"encodeXyz" -- these encode a specific URI component (e.g. path,
query) by percent encoding illegal characters, which includes non-US-ASCII
characters, and also characters that are otherwise illegal within the given
URI component type, as defined in RFC 3986. The effect of this method, with
regards to encoding, is comparable to using the multi-argument constructor
of URI.
"encode" and "encodeUriVariables" -- these can be used
to encode URI variable values by percent encoding all characters that are
either illegal, or have any reserved meaning, anywhere within a URI.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static String | |
| public static String | |
| public static String | Returns: the encoded Stringthe String to be encoded source, String the character encoding to encode to encoding)Variant of |
| public static String | |
| private static String | |
| private static String | |
| public static String | Returns: the encoded authoritythe authority to be encoded authority, String the character encoding to encode to encoding)Encode the given URI authority with the given encoding. |
| public static String | Returns: the encoded authoritythe authority to be encoded authority, Charset the character encoding to encode to charset)Encode the given URI authority with the given encoding. |
| public static String | Returns: the encoded fragmentthe fragment to be encoded fragment, String the character encoding to encode to encoding)Encode the given URI fragment with the given encoding. |
| public static String | Returns: the encoded fragmentthe fragment to be encoded fragment, Charset the character encoding to encode to charset)Encode the given URI fragment with the given encoding. |
| public static String | Returns: the encoded hostthe host to be encoded host, String the character encoding to encode to encoding)Encode the given URI host with the given encoding. |
| public static String | Returns: the encoded hostthe host to be encoded host, Charset the character encoding to encode to charset)Encode the given URI host with the given encoding. |
| public static String | Returns: the encoded paththe path to be encoded path, String the character encoding to encode to encoding)Encode the given URI path with the given encoding. |
| public static String | Returns: the encoded paththe path to be encoded path, Charset the character encoding to encode to charset)Encode the given URI path with the given encoding. |
| public static String | Returns: the encoded segmentthe segment to be encoded segment, String the character encoding to encode to encoding)Encode the given URI path segment with the given encoding. |
| public static String | Returns: the encoded segmentthe segment to be encoded segment, Charset the character encoding to encode to charset)Encode the given URI path segment with the given encoding. |
| public static String | Returns: the encoded portthe port to be encoded port, String the character encoding to encode to encoding)Encode the given URI port with the given encoding. |
| public static String | Returns: the encoded portthe port to be encoded port, Charset the character encoding to encode to charset)Encode the given URI port with the given encoding. |
| public static String | Returns: the encoded querythe query to be encoded query, String the character encoding to encode to encoding)Encode the given URI query with the given encoding. |
| public static String | Returns: the encoded querythe query to be encoded query, Charset the character encoding to encode to charset)Encode the given URI query with the given encoding. |
| public static String | Returns: the encoded query parameterthe query parameter to be encoded queryParam, String the character encoding to encode to encoding)Encode the given URI query parameter with the given encoding. |
| public static String | Returns: the encoded query parameterthe query parameter to be encoded queryParam, Charset the character encoding to encode to charset)Encode the given URI query parameter with the given encoding. |
| public static MultiValueMap | Returns: a newMultiValueMap with the encoded names and valuesthe parameters to encode params)Encode the query parameters from the given |
| public static String | Returns: the encoded schemethe scheme to be encoded scheme, String the character encoding to encode to encoding)Encode the given URI scheme with the given encoding. |
| public static String | Returns: the encoded schemethe scheme to be encoded scheme, Charset the character encoding to encode to charset)Encode the given URI scheme with the given encoding. |
| public static Map | Returns: the encoded Stringthe URI variable values to be encoded uriVariables)Convenience method to apply |
| public static Object[] | Returns: the encoded Stringthe URI variable values to be encoded uriVariables)Convenience method to apply |
| public static String | Returns: the encoded user infothe user info to be encoded userInfo, String the character encoding to encode to encoding)Encode the given URI user info with the given encoding. |
| public static String | Returns: the encoded user infothe user info to be encoded userInfo, Charset the character encoding to encode to charset)Encode the given URI user info with the given encoding. |
| public static String | Returns: the extracted file extension (e.g. "html")the URI path (e.g. "/products/index.html") path)Extract the file extension from the given URI path. |
| UriUtils | back to summary |
|---|---|
| public UriUtils() | |
| decode | back to summary |
|---|---|
| public static String decode(String source, String encoding) Decode the given encoded URI component. See
| |
| decode | back to summary |
|---|---|
| public static String decode(String source, Charset charset) Decode the given encoded URI component. See
| |
| encode | back to summary |
|---|---|
| public static String encode(String source, String encoding) Variant of | |
| encode | back to summary |
|---|---|
| public static String encode(String source, Charset charset) Encode all characters that are either illegal, or have any reserved meaning, anywhere within a URI, as defined in RFC 3986. This is useful to ensure that the given String will be preserved as-is and will not have any impact on the structure or meaning of the URI. | |
| encode | back to summary |
|---|---|
| private static String encode(String scheme, String encoding, HierarchicalUriComponents. | |
| encode | back to summary |
|---|---|
| private static String encode(String scheme, Charset charset, HierarchicalUriComponents. | |
| encodeAuthority | back to summary |
|---|---|
| public static String encodeAuthority(String authority, String encoding) Encode the given URI authority with the given encoding. | |
| encodeAuthority | back to summary |
|---|---|
| public static String encodeAuthority(String authority, Charset charset) Encode the given URI authority with the given encoding. | |
| encodeFragment | back to summary |
|---|---|
| public static String encodeFragment(String fragment, String encoding) Encode the given URI fragment with the given encoding. | |
| encodeFragment | back to summary |
|---|---|
| public static String encodeFragment(String fragment, Charset charset) Encode the given URI fragment with the given encoding. | |
| encodeHost | back to summary |
|---|---|
| public static String encodeHost(String host, String encoding) Encode the given URI host with the given encoding. | |
| encodeHost | back to summary |
|---|---|
| public static String encodeHost(String host, Charset charset) Encode the given URI host with the given encoding. | |
| encodePath | back to summary |
|---|---|
| public static String encodePath(String path, String encoding) Encode the given URI path with the given encoding. | |
| encodePath | back to summary |
|---|---|
| public static String encodePath(String path, Charset charset) Encode the given URI path with the given encoding. | |
| encodePathSegment | back to summary |
|---|---|
| public static String encodePathSegment(String segment, String encoding) Encode the given URI path segment with the given encoding. | |
| encodePathSegment | back to summary |
|---|---|
| public static String encodePathSegment(String segment, Charset charset) Encode the given URI path segment with the given encoding. | |
| encodePort | back to summary |
|---|---|
| public static String encodePort(String port, String encoding) Encode the given URI port with the given encoding. | |
| encodePort | back to summary |
|---|---|
| public static String encodePort(String port, Charset charset) Encode the given URI port with the given encoding. | |
| encodeQuery | back to summary |
|---|---|
| public static String encodeQuery(String query, String encoding) Encode the given URI query with the given encoding. | |
| encodeQuery | back to summary |
|---|---|
| public static String encodeQuery(String query, Charset charset) Encode the given URI query with the given encoding. | |
| encodeQueryParam | back to summary |
|---|---|
| public static String encodeQueryParam(String queryParam, String encoding) Encode the given URI query parameter with the given encoding. | |
| encodeQueryParam | back to summary |
|---|---|
| public static String encodeQueryParam(String queryParam, Charset charset) Encode the given URI query parameter with the given encoding. | |
| encodeQueryParams | back to summary |
|---|---|
| public static MultiValueMap Encode the query parameters from the given This can be used with
| |
| encodeScheme | back to summary |
|---|---|
| public static String encodeScheme(String scheme, String encoding) Encode the given URI scheme with the given encoding. | |
| encodeScheme | back to summary |
|---|---|
| public static String encodeScheme(String scheme, Charset charset) Encode the given URI scheme with the given encoding. | |
| encodeUriVariables | back to summary |
|---|---|
| public static Map Convenience method to apply | |
| encodeUriVariables | back to summary |
|---|---|
| public static Object[] encodeUriVariables(Object... uriVariables) Convenience method to apply | |
| encodeUserInfo | back to summary |
|---|---|
| public static String encodeUserInfo(String userInfo, String encoding) Encode the given URI user info with the given encoding. | |
| encodeUserInfo | back to summary |
|---|---|
| public static String encodeUserInfo(String userInfo, Charset charset) Encode the given URI user info with the given encoding. | |
| extractFileExtension | back to summary |
|---|---|
| public static String extractFileExtension(String path) Extract the file extension from the given URI path. | |