Top Description Fields Constructors Methods
org.postgresql.util

public final Class URLCoder

extends Object
Class Inheritance
Imports
java.io.UnsupportedEncodingException, java.net.URLDecoder, .URLEncoder

This class helps with URL encoding and decoding. UTF-8 encoding is used by default to make encoding consistent across the driver, and encoding might be changed via postgresql.url.encoding property

Note

this should not be used outside of PostgreSQL source, this is not a public API of the driver.

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

decoded value
decode
(String
encoded value
encoded
)

Decodes x-www-form-urlencoded string into Java string.

public static String

Returns:

encoded value
encode
(String
input value
plain
)

Encodes Java string into x-www-form-urlencoded format

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ENCODING_FOR_URLback to summary
private static final String ENCODING_FOR_URL

Constructor Detail

URLCoderback to summary
public URLCoder()

Method Detail

decodeback to summary
public static String decode(String encoded)

Decodes x-www-form-urlencoded string into Java string.

Parameters
encoded:String

encoded value

Returns:String

decoded value

See Also
URLDecoder#decode(String, String)
encodeback to summary
public static String encode(String plain)

Encodes Java string into x-www-form-urlencoded format

Parameters
plain:String

input value

Returns:String

encoded value

See Also
URLEncoder#encode(String, String)