Class UriEscape
Utility class for performing URI escape/unescape operations.
FeaturesSpecific features of the URI escape/unescape operations performed by means of this class:
- Support for percent-encoding-based escape operations (RFC3986) for diverse parts of an URI:
- Paths: Part of the URI path, might include several path levels/segments: /admin/users/list?x=1 → users/list
- Path Segments: Part of the URI path, can include only one path level (/ chars will be escaped): /admin/users/list?x=1 → users
- Query Parameters: Names and values of the URI query parameters: /admin/users/list?x=1 → x (name), 1 (value)
- URI Fragment Identifiers: client-side part of URIs, specified after #: /admin/users/list?x=1#something → #something
- Support for both percent-encoding and + based unescaping of whitespace in query parameters.
There are four different input/output modes that can be used in escape/unescape operations:
- String input, String output: Input is specified as a String object and output is returned as another. In order to improve memory performance, all escape and unescape operations will return the exact same input object as output if no escape/unescape modifications are required.
- String input, java.io.Writer output: Input will be read from a String and output will be written into the specified java.io.Writer.
- java.io.Reader input, java.io.Writer output: Input will be read from a Reader and output will be written into the specified java.io.Writer.
- char[] input, java.io.Writer output: Input will be read from a char array (char[]) and output will be written into the specified java.io.Writer. Two int arguments called offset and len will be used for specifying the part of the char[] that should be escaped/unescaped. These methods should be called with offset = 0 and len = text.length in order to process the whole char[].
- Percent encoding
- The percent-encoding technique for escaping consists of transforming the character that needs to be escaped into a sequence of bytes using a previously specified encoding (UTF-8 by default), and then wrinting each byte as %HH, being HH its hexadecimal value (of the byte).
The following references apply:
- Since:
- 1.1.0
- Author:
- Daniel Fernández
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The default encoding for URI escaping/unescaping: UTF-8. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
escapeUriFragmentId
(char[] text, int offset, int len, Writer writer) Perform am URI fragment identifier escape operation on a char[] input using UTF-8 as encoding.static void
escapeUriFragmentId
(char[] text, int offset, int len, Writer writer, String encoding) Perform am URI fragment identifier escape operation on a char[] input.static void
escapeUriFragmentId
(Reader reader, Writer writer) Perform am URI fragment identifier escape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.static void
escapeUriFragmentId
(Reader reader, Writer writer, String encoding) Perform am URI fragment identifier escape operation on a Reader input, writing results to a Writer.static String
escapeUriFragmentId
(String text) Perform am URI fragment identifier escape operation on a String input using UTF-8 as encoding.static void
escapeUriFragmentId
(String text, Writer writer) Perform am URI fragment identifier escape operation on a String input using UTF-8 as encoding, writing results to a Writer.static void
escapeUriFragmentId
(String text, Writer writer, String encoding) Perform am URI fragment identifier escape operation on a String input, writing results to a Writer.static String
escapeUriFragmentId
(String text, String encoding) Perform am URI fragment identifier escape operation on a String input.static void
escapeUriPath
(char[] text, int offset, int len, Writer writer) Perform am URI path escape operation on a char[] input using UTF-8 as encoding.static void
escapeUriPath
(char[] text, int offset, int len, Writer writer, String encoding) Perform am URI path escape operation on a char[] input.static void
escapeUriPath
(Reader reader, Writer writer) Perform am URI path escape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.static void
escapeUriPath
(Reader reader, Writer writer, String encoding) Perform am URI path escape operation on a Reader input, writing results to a Writer.static String
escapeUriPath
(String text) Perform am URI path escape operation on a String input using UTF-8 as encoding.static void
escapeUriPath
(String text, Writer writer) Perform am URI path escape operation on a String input using UTF-8 as encoding, writing results to a Writer.static void
escapeUriPath
(String text, Writer writer, String encoding) Perform am URI path escape operation on a String input, writing results to a Writer.static String
escapeUriPath
(String text, String encoding) Perform am URI path escape operation on a String input.static void
escapeUriPathSegment
(char[] text, int offset, int len, Writer writer) Perform am URI path segment escape operation on a char[] input using UTF-8 as encoding.static void
escapeUriPathSegment
(char[] text, int offset, int len, Writer writer, String encoding) Perform am URI path segment escape operation on a char[] input.static void
escapeUriPathSegment
(Reader reader, Writer writer) Perform am URI path segment escape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.static void
escapeUriPathSegment
(Reader reader, Writer writer, String encoding) Perform am URI path segment escape operation on a Reader input, writing results to a Writer.static String
escapeUriPathSegment
(String text) Perform am URI path segment escape operation on a String input using UTF-8 as encoding.static void
escapeUriPathSegment
(String text, Writer writer) Perform am URI path segment escape operation on a String input using UTF-8 as encoding, writing results to a Writer.static void
escapeUriPathSegment
(String text, Writer writer, String encoding) Perform am URI path segment escape operation on a String input, writing results to a Writer.static String
escapeUriPathSegment
(String text, String encoding) Perform am URI path segment escape operation on a String input.static void
escapeUriQueryParam
(char[] text, int offset, int len, Writer writer) Perform am URI query parameter (name or value) escape operation on a char[] input using UTF-8 as encoding.static void
escapeUriQueryParam
(char[] text, int offset, int len, Writer writer, String encoding) Perform am URI query parameter (name or value) escape operation on a char[] input.static void
escapeUriQueryParam
(Reader reader, Writer writer) Perform am URI query parameter (name or value) escape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.static void
escapeUriQueryParam
(Reader reader, Writer writer, String encoding) Perform am URI query parameter (name or value) escape operation on a Reader input, writing results to a Writer.static String
escapeUriQueryParam
(String text) Perform am URI query parameter (name or value) escape operation on a String input using UTF-8 as encoding.static void
escapeUriQueryParam
(String text, Writer writer) Perform am URI query parameter (name or value) escape operation on a String input using UTF-8 as encoding, writing results to a Writer.static void
escapeUriQueryParam
(String text, Writer writer, String encoding) Perform am URI query parameter (name or value) escape operation on a String input, writing results to a Writer.static String
escapeUriQueryParam
(String text, String encoding) Perform am URI query parameter (name or value) escape operation on a String input.static void
unescapeUriFragmentId
(char[] text, int offset, int len, Writer writer) Perform am URI fragment identifier unescape operation on a char[] input using UTF-8 as encoding.static void
unescapeUriFragmentId
(char[] text, int offset, int len, Writer writer, String encoding) Perform am URI fragment identifier unescape operation on a char[] input.static void
unescapeUriFragmentId
(Reader reader, Writer writer) Perform am URI fragment identifier unescape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.static void
unescapeUriFragmentId
(Reader reader, Writer writer, String encoding) Perform am URI fragment identifier unescape operation on a Reader input, writing results to a Writer.static String
unescapeUriFragmentId
(String text) Perform am URI fragment identifier unescape operation on a String input using UTF-8 as encoding.static void
unescapeUriFragmentId
(String text, Writer writer) Perform am URI fragment identifier unescape operation on a String input using UTF-8 as encoding, writing results to a Writer.static void
unescapeUriFragmentId
(String text, Writer writer, String encoding) Perform am URI fragment identifier unescape operation on a String input, writing results to a Writer.static String
unescapeUriFragmentId
(String text, String encoding) Perform am URI fragment identifier unescape operation on a String input.static void
unescapeUriPath
(char[] text, int offset, int len, Writer writer) Perform am URI path unescape operation on a char[] input using UTF-8 as encoding.static void
unescapeUriPath
(char[] text, int offset, int len, Writer writer, String encoding) Perform am URI path unescape operation on a char[] input.static void
unescapeUriPath
(Reader reader, Writer writer) Perform am URI path unescape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.static void
unescapeUriPath
(Reader reader, Writer writer, String encoding) Perform am URI path unescape operation on a Reader input, writing results to a Writer.static String
unescapeUriPath
(String text) Perform am URI path unescape operation on a String input using UTF-8 as encoding.static void
unescapeUriPath
(String text, Writer writer) Perform am URI path unescape operation on a String input using UTF-8 as encoding, writing results to a Writer.static void
unescapeUriPath
(String text, Writer writer, String encoding) Perform am URI path unescape operation on a String input, writing results to a Writer.static String
unescapeUriPath
(String text, String encoding) Perform am URI path unescape operation on a String input.static void
unescapeUriPathSegment
(char[] text, int offset, int len, Writer writer) Perform am URI path segment unescape operation on a char[] input using UTF-8 as encoding.static void
unescapeUriPathSegment
(char[] text, int offset, int len, Writer writer, String encoding) Perform am URI path segment unescape operation on a char[] input.static void
unescapeUriPathSegment
(Reader reader, Writer writer) Perform am URI path segment unescape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.static void
unescapeUriPathSegment
(Reader reader, Writer writer, String encoding) Perform am URI path segment unescape operation on a Reader input, writing results to a Writer.static String
unescapeUriPathSegment
(String text) Perform am URI path segment unescape operation on a String input using UTF-8 as encoding.static void
unescapeUriPathSegment
(String text, Writer writer) Perform am URI path segment unescape operation on a String input using UTF-8 as encoding, writing results to a Writer.static void
unescapeUriPathSegment
(String text, Writer writer, String encoding) Perform am URI path segment unescape operation on a String input, writing results to a Writer.static String
unescapeUriPathSegment
(String text, String encoding) Perform am URI path segment unescape operation on a String input.static void
unescapeUriQueryParam
(char[] text, int offset, int len, Writer writer) Perform am URI query parameter (name or value) unescape operation on a char[] input using UTF-8 as encoding.static void
unescapeUriQueryParam
(char[] text, int offset, int len, Writer writer, String encoding) Perform am URI query parameter (name or value) unescape operation on a char[] input.static void
unescapeUriQueryParam
(Reader reader, Writer writer) Perform am URI query parameter (name or value) unescape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.static void
unescapeUriQueryParam
(Reader reader, Writer writer, String encoding) Perform am URI query parameter (name or value) unescape operation on a Reader input, writing results to a Writer.static String
unescapeUriQueryParam
(String text) Perform am URI query parameter (name or value) unescape operation on a String input using UTF-8 as encoding.static void
unescapeUriQueryParam
(String text, Writer writer) Perform am URI query parameter (name or value) unescape operation on a String input using UTF-8 as encoding, writing results to a Writer.static void
unescapeUriQueryParam
(String text, Writer writer, String encoding) Perform am URI query parameter (name or value) unescape operation on a String input, writing results to a Writer.static String
unescapeUriQueryParam
(String text, String encoding) Perform am URI query parameter (name or value) unescape operation on a String input.
-
Field Details
-
DEFAULT_ENCODING
The default encoding for URI escaping/unescaping: UTF-8.- See Also:
-
-
Method Details
-
escapeUriPath
Perform am URI path escape operation on a String input using UTF-8 as encoding.
The following are the only allowed chars in an URI path (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- /
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.
- Parameters:
text
- the String to be escaped.- Returns:
- The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
escapeUriPath
Perform am URI path escape operation on a String input.
The following are the only allowed chars in an URI path (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- /
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.
- Parameters:
text
- the String to be escaped.encoding
- the encoding to be used for unescaping.- Returns:
- The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
escapeUriPathSegment
Perform am URI path segment escape operation on a String input using UTF-8 as encoding.
The following are the only allowed chars in an URI path segment (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
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.
- Parameters:
text
- the String to be escaped.- Returns:
- The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
escapeUriPathSegment
Perform am URI path segment escape operation on a String input.
The following are the only allowed chars in an URI path segment (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
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.
- Parameters:
text
- the String to be escaped.encoding
- the encoding to be used for escaping.- Returns:
- The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
escapeUriQueryParam
Perform am URI query parameter (name or value) escape operation on a String input using UTF-8 as encoding.
The following are the only allowed chars in an URI query parameter (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ ' ( ) * , ;
- : @
- / ?
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.
- Parameters:
text
- the String to be escaped.- Returns:
- The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
escapeUriQueryParam
Perform am URI query parameter (name or value) escape operation on a String input.
The following are the only allowed chars in an URI query parameter (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ ' ( ) * , ;
- : @
- / ?
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.
- Parameters:
text
- the String to be escaped.encoding
- the encoding to be used for escaping.- Returns:
- The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
escapeUriFragmentId
Perform am URI fragment identifier escape operation on a String input using UTF-8 as encoding.
The following are the only allowed chars in an URI fragment identifier (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- / ?
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.
- Parameters:
text
- the String to be escaped.- Returns:
- The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
escapeUriFragmentId
Perform am URI fragment identifier escape operation on a String input.
The following are the only allowed chars in an URI fragment identifier (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- / ?
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.
- Parameters:
text
- the String to be escaped.encoding
- the encoding to be used for escaping.- Returns:
- The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
escapeUriPath
Perform am URI path escape operation on a String input using UTF-8 as encoding, writing results to a Writer.
The following are the only allowed chars in an URI path (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- /
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.
- Parameters:
text
- the String to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriPath
Perform am URI path escape operation on a String input, writing results to a Writer.
The following are the only allowed chars in an URI path (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- /
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.
- Parameters:
text
- the String to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for escaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriPathSegment
Perform am URI path segment escape operation on a String input using UTF-8 as encoding, writing results to a Writer.
The following are the only allowed chars in an URI path segment (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
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.
- Parameters:
text
- the String to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriPathSegment
public static void escapeUriPathSegment(String text, Writer writer, String encoding) throws IOException Perform am URI path segment escape operation on a String input, writing results to a Writer.
The following are the only allowed chars in an URI path segment (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
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.
- Parameters:
text
- the String to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for escaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriQueryParam
Perform am URI query parameter (name or value) escape operation on a String input using UTF-8 as encoding, writing results to a Writer.
The following are the only allowed chars in an URI query parameter (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ ' ( ) * , ;
- : @
- / ?
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.
- Parameters:
text
- the String to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriQueryParam
public static void escapeUriQueryParam(String text, Writer writer, String encoding) throws IOException Perform am URI query parameter (name or value) escape operation on a String input, writing results to a Writer.
The following are the only allowed chars in an URI query parameter (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ ' ( ) * , ;
- : @
- / ?
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.
- Parameters:
text
- the String to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for escaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriFragmentId
Perform am URI fragment identifier escape operation on a String input using UTF-8 as encoding, writing results to a Writer.
The following are the only allowed chars in an URI fragment identifier (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- / ?
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.
- Parameters:
text
- the String to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriFragmentId
public static void escapeUriFragmentId(String text, Writer writer, String encoding) throws IOException Perform am URI fragment identifier escape operation on a String input, writing results to a Writer.
The following are the only allowed chars in an URI fragment identifier (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- / ?
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.
- Parameters:
text
- the String to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for escaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriPath
Perform am URI path escape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.
The following are the only allowed chars in an URI path (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- /
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.
- Parameters:
reader
- the Reader reading the text to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriPath
Perform am URI path escape operation on a Reader input, writing results to a Writer.
The following are the only allowed chars in an URI path (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- /
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.
- Parameters:
reader
- the Reader reading the text to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for escaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriPathSegment
Perform am URI path segment escape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.
The following are the only allowed chars in an URI path segment (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
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.
- Parameters:
reader
- the Reader reading the text to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriPathSegment
public static void escapeUriPathSegment(Reader reader, Writer writer, String encoding) throws IOException Perform am URI path segment escape operation on a Reader input, writing results to a Writer.
The following are the only allowed chars in an URI path segment (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
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.
- Parameters:
reader
- the Reader reading the text to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for escaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriQueryParam
Perform am URI query parameter (name or value) escape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.
The following are the only allowed chars in an URI query parameter (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ ' ( ) * , ;
- : @
- / ?
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.
- Parameters:
reader
- the Reader reading the text to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriQueryParam
public static void escapeUriQueryParam(Reader reader, Writer writer, String encoding) throws IOException Perform am URI query parameter (name or value) escape operation on a Reader input, writing results to a Writer.
The following are the only allowed chars in an URI query parameter (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ ' ( ) * , ;
- : @
- / ?
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.
- Parameters:
reader
- the Reader reading the text to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for escaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriFragmentId
Perform am URI fragment identifier escape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.
The following are the only allowed chars in an URI fragment identifier (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- / ?
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.
- Parameters:
reader
- the Reader reading the text to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriFragmentId
public static void escapeUriFragmentId(Reader reader, Writer writer, String encoding) throws IOException Perform am URI fragment identifier escape operation on a Reader input, writing results to a Writer.
The following are the only allowed chars in an URI fragment identifier (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- / ?
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.
- Parameters:
reader
- the Reader reading the text to be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for escaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
escapeUriPath
public static void escapeUriPath(char[] text, int offset, int len, Writer writer) throws IOException Perform am URI path escape operation on a char[] input using UTF-8 as encoding.
The following are the only allowed chars in an URI path (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- /
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.
- Parameters:
text
- the char[] to be escaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs
-
escapeUriPath
public static void escapeUriPath(char[] text, int offset, int len, Writer writer, String encoding) throws IOException Perform am URI path escape operation on a char[] input.
The following are the only allowed chars in an URI path (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- /
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.
- Parameters:
text
- the char[] to be escaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for escaping.- Throws:
IOException
- if an input/output exception occurs
-
escapeUriPathSegment
public static void escapeUriPathSegment(char[] text, int offset, int len, Writer writer) throws IOException Perform am URI path segment escape operation on a char[] input using UTF-8 as encoding.
The following are the only allowed chars in an URI path segment (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
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.
- Parameters:
text
- the char[] to be escaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs
-
escapeUriPathSegment
public static void escapeUriPathSegment(char[] text, int offset, int len, Writer writer, String encoding) throws IOException Perform am URI path segment escape operation on a char[] input.
The following are the only allowed chars in an URI path segment (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
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.
- Parameters:
text
- the char[] to be escaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for escaping.- Throws:
IOException
- if an input/output exception occurs
-
escapeUriQueryParam
public static void escapeUriQueryParam(char[] text, int offset, int len, Writer writer) throws IOException Perform am URI query parameter (name or value) escape operation on a char[] input using UTF-8 as encoding.
The following are the only allowed chars in an URI query parameter (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ ' ( ) * , ;
- : @
- / ?
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.
- Parameters:
text
- the char[] to be escaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs
-
escapeUriQueryParam
public static void escapeUriQueryParam(char[] text, int offset, int len, Writer writer, String encoding) throws IOException Perform am URI query parameter (name or value) escape operation on a char[] input.
The following are the only allowed chars in an URI query parameter (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ ' ( ) * , ;
- : @
- / ?
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.
- Parameters:
text
- the char[] to be escaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for escaping.- Throws:
IOException
- if an input/output exception occurs
-
escapeUriFragmentId
public static void escapeUriFragmentId(char[] text, int offset, int len, Writer writer) throws IOException Perform am URI fragment identifier escape operation on a char[] input using UTF-8 as encoding.
The following are the only allowed chars in an URI fragment identifier (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- / ?
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.
- Parameters:
text
- the char[] to be escaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs
-
escapeUriFragmentId
public static void escapeUriFragmentId(char[] text, int offset, int len, Writer writer, String encoding) throws IOException Perform am URI fragment identifier escape operation on a char[] input.
The following are the only allowed chars in an URI fragment identifier (will not be escaped):
- A-Z a-z 0-9
- - . _ ~
- ! $ & ' ( ) * + , ; =
- : @
- / ?
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.
- Parameters:
text
- the char[] to be escaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for escaping.- Throws:
IOException
- if an input/output exception occurs
-
unescapeUriPath
Perform am URI path unescape operation on a String input using UTF-8 as encoding.
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.
- Parameters:
text
- the String to be unescaped.- Returns:
- The unescaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no unescaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
unescapeUriPath
Perform am URI path unescape operation on a String input.
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.
- Parameters:
text
- the String to be unescaped.encoding
- the encoding to be used for unescaping.- Returns:
- The unescaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no unescaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
unescapeUriPathSegment
Perform am URI path segment unescape operation on a String input using UTF-8 as encoding.
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.
- Parameters:
text
- the String to be unescaped.- Returns:
- The unescaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no unescaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
unescapeUriPathSegment
Perform am URI path segment unescape operation on a String input.
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.
- Parameters:
text
- the String to be unescaped.encoding
- the encoding to be used for unescaping.- Returns:
- The unescaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no unescaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
unescapeUriQueryParam
Perform am URI query parameter (name or value) unescape operation on a String input using UTF-8 as encoding.
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.
- Parameters:
text
- the String to be unescaped.- Returns:
- The unescaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no unescaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
unescapeUriQueryParam
Perform am URI query parameter (name or value) unescape operation on a String input.
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.
- Parameters:
text
- the String to be unescaped.encoding
- the encoding to be used for unescaping.- Returns:
- The unescaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no unescaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
unescapeUriFragmentId
Perform am URI fragment identifier unescape operation on a String input using UTF-8 as encoding.
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.
- Parameters:
text
- the String to be unescaped.- Returns:
- The unescaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no unescaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
unescapeUriFragmentId
Perform am URI fragment identifier unescape operation on a String input.
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.
- Parameters:
text
- the String to be unescaped.encoding
- the encoding to be used for unescaping.- Returns:
- The unescaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no unescaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.
-
unescapeUriPath
Perform am URI path unescape operation on a String input using UTF-8 as encoding, writing results to a Writer.
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.
- Parameters:
text
- the String to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriPath
Perform am URI path unescape operation on a String input, writing results to a Writer.
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.
- Parameters:
text
- the String to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for unescaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriPathSegment
Perform am URI path segment unescape operation on a String input using UTF-8 as encoding, writing results to a Writer.
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.
- Parameters:
text
- the String to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriPathSegment
public static void unescapeUriPathSegment(String text, Writer writer, String encoding) throws IOException Perform am URI path segment unescape operation on a String input, writing results to a Writer.
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.
- Parameters:
text
- the String to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for unescaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriQueryParam
Perform am URI query parameter (name or value) unescape operation on a String input using UTF-8 as encoding, writing results to a Writer.
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.
- Parameters:
text
- the String to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriQueryParam
public static void unescapeUriQueryParam(String text, Writer writer, String encoding) throws IOException Perform am URI query parameter (name or value) unescape operation on a String input, writing results to a Writer.
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.
- Parameters:
text
- the String to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for unescaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriFragmentId
Perform am URI fragment identifier unescape operation on a String input using UTF-8 as encoding, writing results to a Writer.
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.
- Parameters:
text
- the String to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriFragmentId
public static void unescapeUriFragmentId(String text, Writer writer, String encoding) throws IOException Perform am URI fragment identifier unescape operation on a String input, writing results to a Writer.
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.
- Parameters:
text
- the String to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for unescaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriPath
Perform am URI path unescape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.
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.
- Parameters:
reader
- the Reader reading the text to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriPath
public static void unescapeUriPath(Reader reader, Writer writer, String encoding) throws IOException Perform am URI path unescape operation on a Reader input, writing results to a Writer.
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.
- Parameters:
reader
- the Reader reading the text to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for unescaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriPathSegment
Perform am URI path segment unescape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.
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.
- Parameters:
reader
- the Reader reading the text to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriPathSegment
public static void unescapeUriPathSegment(Reader reader, Writer writer, String encoding) throws IOException Perform am URI path segment unescape operation on a Reader input, writing results to a Writer.
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.
- Parameters:
reader
- the Reader reading the text to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for unescaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriQueryParam
Perform am URI query parameter (name or value) unescape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.
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.
- Parameters:
reader
- the Reader reading the text to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriQueryParam
public static void unescapeUriQueryParam(Reader reader, Writer writer, String encoding) throws IOException Perform am URI query parameter (name or value) unescape operation on a Reader input, writing results to a Writer.
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.
- Parameters:
reader
- the Reader reading the text to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for unescaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriFragmentId
Perform am URI fragment identifier unescape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.
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.
- Parameters:
reader
- the Reader reading the text to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriFragmentId
public static void unescapeUriFragmentId(Reader reader, Writer writer, String encoding) throws IOException Perform am URI fragment identifier unescape operation on a Reader input, writing results to a Writer.
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.
- Parameters:
reader
- the Reader reading the text to be unescaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for unescaping.- Throws:
IOException
- if an input/output exception occurs- Since:
- 1.1.2
-
unescapeUriPath
public static void unescapeUriPath(char[] text, int offset, int len, Writer writer) throws IOException Perform am URI path unescape operation on a char[] input using UTF-8 as encoding.
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.
- Parameters:
text
- the char[] to be unescaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs
-
unescapeUriPath
public static void unescapeUriPath(char[] text, int offset, int len, Writer writer, String encoding) throws IOException Perform am URI path unescape operation on a char[] input.
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.
- Parameters:
text
- the char[] to be unescaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for unescaping.- Throws:
IOException
- if an input/output exception occurs
-
unescapeUriPathSegment
public static void unescapeUriPathSegment(char[] text, int offset, int len, Writer writer) throws IOException Perform am URI path segment unescape operation on a char[] input using UTF-8 as encoding.
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.
- Parameters:
text
- the char[] to be unescaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs
-
unescapeUriPathSegment
public static void unescapeUriPathSegment(char[] text, int offset, int len, Writer writer, String encoding) throws IOException Perform am URI path segment unescape operation on a char[] input.
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.
- Parameters:
text
- the char[] to be unescaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for unescaping.- Throws:
IOException
- if an input/output exception occurs
-
unescapeUriQueryParam
public static void unescapeUriQueryParam(char[] text, int offset, int len, Writer writer) throws IOException Perform am URI query parameter (name or value) unescape operation on a char[] input using UTF-8 as encoding.
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.
- Parameters:
text
- the char[] to be unescaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs
-
unescapeUriQueryParam
public static void unescapeUriQueryParam(char[] text, int offset, int len, Writer writer, String encoding) throws IOException Perform am URI query parameter (name or value) unescape operation on a char[] input.
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.
- Parameters:
text
- the char[] to be unescaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for unescaping.- Throws:
IOException
- if an input/output exception occurs
-
unescapeUriFragmentId
public static void unescapeUriFragmentId(char[] text, int offset, int len, Writer writer) throws IOException Perform am URI fragment identifier unescape operation on a char[] input using UTF-8 as encoding.
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.
- Parameters:
text
- the char[] to be unescaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.- Throws:
IOException
- if an input/output exception occurs
-
unescapeUriFragmentId
public static void unescapeUriFragmentId(char[] text, int offset, int len, Writer writer, String encoding) throws IOException Perform am URI fragment identifier unescape operation on a char[] input.
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.
- Parameters:
text
- the char[] to be unescaped.offset
- the position in text at which the escape operation should start.len
- the number of characters in text that should be escaped.writer
- the java.io.Writer to which the unescaped result will be written. Nothing will be written at all to this writer if input is null.encoding
- the encoding to be used for unescaping.- Throws:
IOException
- if an input/output exception occurs
-