public final class Uris extends Object
Expression Object for performing URI/URL operations (esp.escaping/unescaping) inside Thymeleaf Standard Expressions.
An object of this class is usually available in variable evaluation expressions with the name #uris.
Constructor and Description |
---|
Uris() |
Modifier and Type | Method and Description |
---|---|
String |
escapeFragmentId(String text)
Perform am URI fragment identifier escape operation
on a String input using UTF-8 as encoding.
|
String |
escapeFragmentId(String text,
String encoding)
Perform am URI fragment identifier escape operation
on a String input.
|
String |
escapePath(String text)
Perform am URI path escape operation
on a String input using UTF-8 as encoding.
|
String |
escapePath(String text,
String encoding)
Perform am URI path escape operation
on a String input.
|
String |
escapePathSegment(String text)
Perform am URI path segment escape operation
on a String input using UTF-8 as encoding.
|
String |
escapePathSegment(String text,
String encoding)
Perform am URI path segment escape operation
on a String input.
|
String |
escapeQueryParam(String text)
Perform am URI query parameter (name or value) escape operation
on a String input using UTF-8 as encoding.
|
String |
escapeQueryParam(String text,
String encoding)
Perform am URI query parameter (name or value) escape operation
on a String input.
|
String |
unescapeFragmentId(String text)
Perform am URI fragment identifier unescape operation
on a String input using UTF-8 as encoding.
|
String |
unescapeFragmentId(String text,
String encoding)
Perform am URI fragment identifier unescape operation
on a String input.
|
String |
unescapePath(String text)
Perform am URI path unescape operation
on a String input using UTF-8 as encoding.
|
String |
unescapePath(String text,
String encoding)
Perform am URI path unescape operation
on a String input.
|
String |
unescapePathSegment(String text)
Perform am URI path segment unescape operation
on a String input using UTF-8 as encoding.
|
String |
unescapePathSegment(String text,
String encoding)
Perform am URI path segment unescape operation
on a String input.
|
String |
unescapeQueryParam(String text)
Perform am URI query parameter (name or value) unescape operation
on a String input using UTF-8 as encoding.
|
String |
unescapeQueryParam(String text,
String encoding)
Perform am URI query parameter (name or value) unescape operation
on a String input.
|
public String escapePath(String text)
Perform am URI path escape operation on a String input using UTF-8 as encoding.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
The following are the only allowed chars in an URI path (will not be escaped):
All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.
This method is thread-safe.
text
- the String to be escaped.public String unescapePath(String text)
Perform am URI path unescape operation on a String input using UTF-8 as encoding.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
This method will unescape every percent-encoded (%HH) sequences present in input, even for those characters that do not need to be percent-encoded in this context (unreserved characters can be percent-encoded even if/when this is not required, though it is not generally considered a good practice).
This method will use UTF-8 in order to determine the characters specified in the percent-encoded byte sequences.
This method is thread-safe.
text
- the String to be unescaped.public String escapePath(String text, String encoding)
Perform am URI path escape operation on a String input.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
The following are the only allowed chars in an URI path (will not be escaped):
All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.
This method is thread-safe.
text
- the String to be escaped.encoding
- the encoding to be used for unescaping.public String unescapePath(String text, String encoding)
Perform am URI path unescape operation on a String input.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
This method will unescape every percent-encoded (%HH) sequences present in input, even for those characters that do not need to be percent-encoded in this context (unreserved characters can be percent-encoded even if/when this is not required, though it is not generally considered a good practice).
This method will use the specified encoding in order to determine the characters specified in the percent-encoded byte sequences.
This method is thread-safe.
text
- the String to be unescaped.encoding
- the encoding to be used for unescaping.public String escapePathSegment(String text)
Perform am URI path segment escape operation on a String input using UTF-8 as encoding.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
The following are the only allowed chars in an URI path segment (will not be escaped):
All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.
This method is thread-safe.
text
- the String to be escaped.public String unescapePathSegment(String text)
Perform am URI path segment unescape operation on a String input using UTF-8 as encoding.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
This method will unescape every percent-encoded (%HH) sequences present in input, even for those characters that do not need to be percent-encoded in this context (unreserved characters can be percent-encoded even if/when this is not required, though it is not generally considered a good practice).
This method will use UTF-8 in order to determine the characters specified in the percent-encoded byte sequences.
This method is thread-safe.
text
- the String to be unescaped.public String escapePathSegment(String text, String encoding)
Perform am URI path segment escape operation on a String input.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
The following are the only allowed chars in an URI path segment (will not be escaped):
All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.
This method is thread-safe.
text
- the String to be escaped.encoding
- the encoding to be used for escaping.public String unescapePathSegment(String text, String encoding)
Perform am URI path segment unescape operation on a String input.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
This method will unescape every percent-encoded (%HH) sequences present in input, even for those characters that do not need to be percent-encoded in this context (unreserved characters can be percent-encoded even if/when this is not required, though it is not generally considered a good practice).
This method will use specified encoding in order to determine the characters specified in the percent-encoded byte sequences.
This method is thread-safe.
text
- the String to be unescaped.encoding
- the encoding to be used for unescaping.public String escapeFragmentId(String text)
Perform am URI fragment identifier escape operation on a String input using UTF-8 as encoding.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
The following are the only allowed chars in an URI fragment identifier (will not be escaped):
All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.
This method is thread-safe.
text
- the String to be escaped.public String unescapeFragmentId(String text)
Perform am URI fragment identifier unescape operation on a String input using UTF-8 as encoding.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
This method will unescape every percent-encoded (%HH) sequences present in input, even for those characters that do not need to be percent-encoded in this context (unreserved characters can be percent-encoded even if/when this is not required, though it is not generally considered a good practice).
This method will use UTF-8 in order to determine the characters specified in the percent-encoded byte sequences.
This method is thread-safe.
text
- the String to be unescaped.public String escapeFragmentId(String text, String encoding)
Perform am URI fragment identifier escape operation on a String input.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
The following are the only allowed chars in an URI fragment identifier (will not be escaped):
All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.
This method is thread-safe.
text
- the String to be escaped.encoding
- the encoding to be used for escaping.public String unescapeFragmentId(String text, String encoding)
Perform am URI fragment identifier unescape operation on a String input.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
This method will unescape every percent-encoded (%HH) sequences present in input, even for those characters that do not need to be percent-encoded in this context (unreserved characters can be percent-encoded even if/when this is not required, though it is not generally considered a good practice).
This method will use specified encoding in order to determine the characters specified in the percent-encoded byte sequences.
This method is thread-safe.
text
- the String to be unescaped.encoding
- the encoding to be used for unescaping.public String escapeQueryParam(String text)
Perform am URI query parameter (name or value) escape operation on a String input using UTF-8 as encoding.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
The following are the only allowed chars in an URI query parameter (will not be escaped):
All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.
This method is thread-safe.
text
- the String to be escaped.public String unescapeQueryParam(String text)
Perform am URI query parameter (name or value) unescape operation on a String input using UTF-8 as encoding.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
This method will unescape every percent-encoded (%HH) sequences present in input, even for those characters that do not need to be percent-encoded in this context (unreserved characters can be percent-encoded even if/when this is not required, though it is not generally considered a good practice).
This method will use UTF-8 in order to determine the characters specified in the percent-encoded byte sequences.
This method is thread-safe.
text
- the String to be unescaped.public String escapeQueryParam(String text, String encoding)
Perform am URI query parameter (name or value) escape operation on a String input.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
The following are the only allowed chars in an URI query parameter (will not be escaped):
All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.
This method is thread-safe.
text
- the String to be escaped.encoding
- the encoding to be used for escaping.public String unescapeQueryParam(String text, String encoding)
Perform am URI query parameter (name or value) unescape operation on a String input.
This method simply calls the equivalent method in the UriEscape class from the Unbescape library.
This method will unescape every percent-encoded (%HH) sequences present in input, even for those characters that do not need to be percent-encoded in this context (unreserved characters can be percent-encoded even if/when this is not required, though it is not generally considered a good practice).
This method will use specified encoding in order to determine the characters specified in the percent-encoded byte sequences.
This method is thread-safe.
text
- the String to be unescaped.encoding
- the encoding to be used for unescaping.Copyright © 2016 The THYMELEAF team. All rights reserved.