Top Constructors Methods
io.vertx.core.net.impl

public final Class URIDecoder

extends Object
Class Inheritance
Imports
java.nio.charset.StandardCharsets

Author
Paulo Lopes

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static String
decodeAndTransformURIComponent(String s, int i, boolean plus)

private static char

Returns:

The hexadecimal value represented in the ASCII character given, or Character#MAX_VALUE if the character is invalid.
decodeHexNibble
(final char
The ASCII character of the hexadecimal number to decode. Must be in the range [0-9a-fA-F].
c
)

Helper to decode half of a hexadecimal number from a string.

public static String

Returns:

decoded string
decodeURIComponent
(String
string to decode
s
)

Decodes a segment of an URI encoded by a browser.

public static String

Returns:

decoded string
decodeURIComponent
(String
string to decode
s
,
boolean
weather or not to transform plus signs into spaces
plus
)

Decodes a segment of an URI encoded by a browser.

private static int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

URIDecoderback to summary
private URIDecoder()

Method Detail

decodeAndTransformURIComponentback to summary
private static String decodeAndTransformURIComponent(String s, int i, boolean plus)
decodeHexNibbleback to summary
private static char decodeHexNibble(final char c)

Helper to decode half of a hexadecimal number from a string.

Parameters
c:char

The ASCII character of the hexadecimal number to decode. Must be in the range [0-9a-fA-F].

Returns:char

The hexadecimal value represented in the ASCII character given, or Character#MAX_VALUE if the character is invalid.

decodeURIComponentback to summary
public static String decodeURIComponent(String s)

Decodes a segment of an URI encoded by a browser. The string is expected to be encoded as per RFC 3986, Section 2. This is the encoding used by JavaScript functions encodeURI and encodeURIComponent, but not escape. For example in this encoding, é (in Unicode U+00E9 or in UTF-8 0xC3 0xA9) is encoded as %C3%A9 or %c3%a9. Plus signs '+' will be handled as spaces and encoded using the default JDK URLEncoder class.

Parameters
s:String

string to decode

Returns:String

decoded string

decodeURIComponentback to summary
public static String decodeURIComponent(String s, boolean plus)

Decodes a segment of an URI encoded by a browser. The string is expected to be encoded as per RFC 3986, Section 2. This is the encoding used by JavaScript functions encodeURI and encodeURIComponent, but not escape. For example in this encoding, é (in Unicode U+00E9 or in UTF-8 0xC3 0xA9) is encoded as %C3%A9 or %c3%a9.

Parameters
s:String

string to decode

plus:boolean

weather or not to transform plus signs into spaces

Returns:String

decoded string

indexOfPercentOrPlusback to summary
private static int indexOfPercentOrPlus(String s)