Java Utililty Methods URL Encode

List of utility methods to do URL Encode

  1. HOME
  2. Java
  3. U
  4. URL Encode

Description

The list of methods to do URL Encode are organized into topic(s).

Method

String encode(byte[] bytes, String encoding)
Encode a byte string as a String.
if (bytes == null) {
 return null;
} else if (encoding == null) {
 return urlEncode(bytes);
} else if ("url".equals(encoding)) {
 return urlEncode(bytes);
} else if ("hex".equals(encoding)) {
 return toHex(bytes);
...
String encode(final Object id)
encode
if (id instanceof String)
 return URLEncoder.encode(id.toString());
else
 return id.toString();
String encode(final String content, final String encoding)
encode
try {
 return URLEncoder.encode(content, encoding != null ? encoding : "UTF-8");
} catch (UnsupportedEncodingException problem) {
 throw new IllegalArgumentException(problem);
String encode(final String raw)
Encodes the given raw text using the UTF-8 URL encoding scheme.
try {
 return URLEncoder.encode(raw, "UTF-8");
} catch (final UnsupportedEncodingException e) {
 return raw; 
String encode(final String s, final String enc)
<#if locale="en">

Encode string with the encode character.

try {
 return URLEncoder.encode(s, enc);
} catch (final UnsupportedEncodingException e) {
 throw new RuntimeException(e);
String encode(final String string)
URL encodes the specified string using the ISO-8859-1 encoding if applicable, otherwise the system default encoding will be used.
return encode(string, null);
String encode(final String value, final String charset)
encode
try {
 return URLEncoder.encode(value, charset);
} catch (UnsupportedEncodingException e) {
 throw new IllegalStateException(e);
String encode(HashMap map)
encode
if (map == null) {
 return null;
StringBuilder str = new StringBuilder();
Set<String> keys = map.keySet();
boolean first = true;
for (String key : keys) {
 Object value = map.get(key);
...
String encode(Object parameter)
URL encode a single query parameter.
if (parameter == null) {
 return null;
try {
 return URLEncoder.encode(parameter.toString(), "UTF-8");
} catch (UnsupportedEncodingException e) {
 throw new RuntimeException(e);
String encode(Object value)
encode
if (value == null)
 return "";
try {
 return URLEncoder.encode(value.toString(), "UTF-8");
} catch (UnsupportedEncodingException e) {
 return value.toString();


AltStyle によって変換されたページ (->オリジナル) /