List of utility methods to do URI Encode
String | encodeURIParam(String s) encode URI Param String ret = null; try { ret = URLEncoder.encode(s, "UTF-8"); } catch (UnsupportedEncodingException e) { throw e; return ret; |
void | encodeURIString(Writer out, String text, String encoding, int start) encode URI String ByteArrayOutputStream buf = null; OutputStreamWriter writer = null; char[] charArray = null; int length = text.length(); for (int i = start; i < length; i++) { char ch = text.charAt(i); if (DONT_ENCODE_SET.get(ch)) { out.write(ch); ... |
String | encodeUriWithPrefix(String uri) Elements (identifiers) used in MDX need to follow certain rules in order to be parseable from and to MDX. return encodeSpecialMdxCharactersInNames(uri);
|
String | uriEncode(Object o) uri Encode try { assert (o != null) : "o canot be null"; return URLEncoder.encode(o.toString(), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("UTF-8 is not supported by this system?", e); |
String | uriEncode(String decoded) uri Encode return URLEncoder.encode(decoded, "UTF-8"); |
String | uriEncode(String input) uri Encode return URLEncoder.encode(input, "UTF-8").replace("+", "%20"); |
String | uriEncodePath(String path) uri Encode Path try { URI uri = new URI(null, null, path, null); return uri.toASCIIString(); } catch (URISyntaxException e) { throw new IllegalArgumentException(String.format("uriEncode failed, path=\"%s\".", path), e); |
String | uriEncoding(String plainString) uri Encoding try { URL url = new URL(plainString); URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef()); return uri.toString(); } catch (URISyntaxException | MalformedURLException e) { System.out.println("Utilities.uriEncoding(String plainString)\nError trying to encode " + plainString); return null; ... |