List of utility methods to do URL Encode
String | encode(String string) encode try { return URLEncoder.encode(string, "UTF-8").replaceAll("\\+", "%20"); } catch (UnsupportedEncodingException e) { return null; |
String | encode(String strInput) Encode URL string by method URLEncoder.encode() - after this encoding all spaces will be encoded as + character. String strEncoded = URLEncoder.encode(strInput, "UTF-8"); return strEncoded.replaceAll("\\+", "%20"); |
String | encode(String text) Encode text as UTF-8 return URLEncoder.encode(text, "UTF-8"); |
String | encode(String toBeEncoded, String charSet, String defaultReturnValue) encode String encodedString; try { encodedString = URLEncoder.encode(toBeEncoded, charSet); } catch (Exception var5) { System.err.println(String.format("Error when url-encode:%s with charset:%s", new Object[] { toBeEncoded == null ? "" : toBeEncoded, charSet == null ? "" : charSet })); var5.printStackTrace(); encodedString = defaultReturnValue; ... |
String | encode(String value) encode String encoded = null; try { encoded = URLEncoder.encode(value, "UTF-8"); } catch (UnsupportedEncodingException ignore) { StringBuilder buf = new StringBuilder(encoded.length()); char focus; for (int i = 0; i < encoded.length(); i++) { ... |
String | encode(String value) encode if (value != null) { return URLEncoder.encode(value, "utf8"); } else { return ""; |
String | encode(String value) encode if (isEmpty(value)) { return ""; try { value = java.net.URLEncoder.encode(value, "utf-8"); } catch (Exception ex) { ex.printStackTrace(); return value; |
String | encode(String value) URL encodes a value using the UTF-8 charset return URLEncoder.encode(value, "UTF-8"); |
String | encode(String value, String charset) encode String result = null; if (!isEmpty(value)) { try { result = URLEncoder.encode(value, charset); } catch (IOException e) { throw new RuntimeException(e); return result; |
String | encode(String value, String encoding) Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme.
String encodedValue = null; try { encodedValue = URLEncoder.encode(value, encoding); } catch (Exception e) { throw new IllegalArgumentException(e.getMessage()); return encodedValue; |