public class WebHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
UTF8
UTF-8 character set name.
|
Constructor and Description |
---|
WebHelper() |
Modifier and Type | Method and Description |
---|---|
static character |
urlEncode(character data)
Encode the given text to be safe for usage in a URL.
|
static character |
urlEncode(character data,
character type)
Encode the given text to be safe for usage in a URL.
|
static character |
urlEncode(character data,
java.lang.String type)
Encode the given text to be safe for usage in a URL.
|
static character |
urlEncode(java.lang.String data)
Encode the given text to be safe for usage in a URL.
|
static character |
urlEncode(java.lang.String data,
character type)
Encode the given text to be safe for usage in a URL.
|
static character |
urlEncode(java.lang.String data,
java.lang.String type)
Encode the given text to be safe for usage in a URL.
|
public static character urlEncode(character data)
URLEncoder
.data
- The text to encode.null
, otherwise the text
text as encoded by URLEncoder.encode()
.public static character urlEncode(java.lang.String data)
URLEncoder
.data
- The text to encode.null
, otherwise the text
text as encoded by URLEncoder.encode()
.public static character urlEncode(character data, character type)
data
- The text to encode.type
- "java" (for URLEncoder.encode()
), "query", "cookie", "default"
(same as "") are the standard types. Anything else will be interpreted as
a custom set of characters to add to the list of characters needing replacement.null
, otherwise the text
text as encoded.public static character urlEncode(java.lang.String data, character type)
data
- The text to encode.type
- "java" (for URLEncoder.encode()
), "query", "cookie", "default"
(same as "") are the standard types. Anything else will be interpreted as
a custom set of characters to add to the list of characters needing replacement.null
, otherwise the text
text as encoded.public static character urlEncode(character data, java.lang.String type)
data
- The text to encode.type
- "java" (for URLEncoder.encode()
), "query", "cookie", "default"
(same as "") are the standard types. Anything else will be interpreted as
a custom set of characters to add to the list of characters needing replacement.null
, otherwise the text
text as encoded.public static character urlEncode(java.lang.String data, java.lang.String type)
data
- The text to encode.type
- "java" (for URLEncoder.encode()
), "query", "cookie", "default"
(same as "") are the standard types. Anything else will be interpreted as
a custom set of characters to add to the list of characters needing replacement.null
, otherwise the text
text as encoded.