@Test public void testUrlEncodeQueryParamsUrlEncodeFalse() throws Exception { String queryParams = "pa%20ra+m 1=The+string+%40foo-bar"; String encodeQueryParams = Utils.urlEncodeQueryParams(queryParams, false); assertEquals("pa ra m 1=The string @foo-bar", encodeQueryParams); queryParams = "param1=The%20st+ring %40foo-bar"; encodeQueryParams = Utils.urlEncodeQueryParams(queryParams, false); assertEquals("param1=The st ring @foo-bar", encodeQueryParams); }
public static String urlEncodeQueryParams(String params, boolean urlEncode) throws UrlEncodeException { String encodedParams = params; if (!urlEncode) { try { encodedParams = URLDecoder.decode(params, DEFAULT_CHARACTER_SET); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } catch (IllegalArgumentException ie) { throw new UrlEncodeException(ie.getMessage(), ie); } } return encodedParams; }
Utils { public static String urlEncodeQueryParams(String params, boolean urlEncode) throws UrlEncodeException { String encodedParams = params; if (!urlEncode) { try { encodedParams = URLDecoder.decode(params, DEFAULT_CHARACTER_SET); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } catch (IllegalArgumentException ie) { throw new UrlEncodeException(ie.getMessage(), ie); } } return encodedParams; } }
Utils { public static String urlEncodeQueryParams(String params, boolean urlEncode) throws UrlEncodeException { String encodedParams = params; if (!urlEncode) { try { encodedParams = URLDecoder.decode(params, DEFAULT_CHARACTER_SET); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } catch (IllegalArgumentException ie) { throw new UrlEncodeException(ie.getMessage(), ie); } } return encodedParams; }  }
Utils { public static String urlEncodeQueryParams(String params, boolean urlEncode) throws UrlEncodeException { String encodedParams = params; if (!urlEncode) { try { encodedParams = URLDecoder.decode(params, DEFAULT_CHARACTER_SET); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } catch (IllegalArgumentException ie) { throw new UrlEncodeException(ie.getMessage(), ie); } } return encodedParams; }  static List<? extends NameValuePair> urlEncodeMultipleParams(String params, boolean urlEncode); static String urlEncodeQueryParams(String params, boolean urlEncode); static int validatePortNumber(String portStringValue); }
Utils { public static String urlEncodeQueryParams(String params, boolean urlEncode) throws UrlEncodeException { String encodedParams = params; if (!urlEncode) { try { encodedParams = URLDecoder.decode(params, DEFAULT_CHARACTER_SET); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } catch (IllegalArgumentException ie) { throw new UrlEncodeException(ie.getMessage(), ie); } } return encodedParams; }  static List<? extends NameValuePair> urlEncodeMultipleParams(String params, boolean urlEncode); static String urlEncodeQueryParams(String params, boolean urlEncode); static int validatePortNumber(String portStringValue); static final String DEFAULT_CHARACTER_SET; }