List of utility methods to do URL Encode
String | urlEncodeForSpaces(String input) This method encodes the url, removes the spaces from the url and replaces the same with "%20" .
return urlEncodeForSpaces(input.toCharArray());
|
String | urlEncodeForSpaces(String input) This method encodes the URL, removes the spaces from the URL and replaces the same with "%20" .
if (input == null) { return null; return urlEncodeForSpaces(input.toCharArray()); |
String | urlEncodeParameter(String value) url Encode Parameter char[] chars = value.toCharArray(); StringBuilder sb = new StringBuilder(); for (char character : chars) { if (character == '&') sb.append("%26"); else if (character == '=') sb.append("%3D"); else if (character == '#') ... |
String | URLEncoder(String str) URL Encoder if (str == null) { return null; StringBuffer resultStr = new StringBuffer(str.length()); char tmpChar; for (int ix = 0; ix < str.length(); ix++) { tmpChar = str.charAt(ix); switch (tmpChar) { ... |
String | urlEncodeSpace(String s) _more_ return s.replaceAll(" ", "+"); |
String | urlParameterEncode(String s) like urlEncode, but adds the equal sign boolean changed = false; char c; StringBuffer sb = null; for (int i = 0; i < s.length(); i++) { c = s.charAt(i); if (c == ' ' || c == '+' || c == '<' || c == '&' || c == '>' || c == '"' || c == '\'' || c == '=' || c > 0x7f) { if (!changed) { ... |
char[] | urlPercentEncodeTwo(char c) url Percent Encode Two char[] result = null; int ci = c; int leftNibble = (0xF0 & ci) >> 4; int rightNibble = (0x0F & ci); result = new char[] { PERCENT_SYMBOL, HEX_TO_CHAR[leftNibble], HEX_TO_CHAR[rightNibble] }; return result; |