@Test public void testDecode() throws Exception { assertEquals("%test", RequestUtils.decode("%test", "utf-8")); assertEquals("%test", RequestUtils.decode("%25test", "utf-8")); }
static String decode(String s, String encoding) throws UnsupportedEncodingException { s = StringUtils.trimToEmpty(s); while (true) { try { return URLDecoder.decode(s, encoding); } catch (IllegalArgumentException e) { String m = e.getMessage(); String illegalSequence = m.substring(m.length() - 3, m.length() - 1); s = s.replaceAll("%" + illegalSequence, "%25" + illegalSequence); } } }
RequestUtils { static String decode(String s, String encoding) throws UnsupportedEncodingException { s = StringUtils.trimToEmpty(s); while (true) { try { return URLDecoder.decode(s, encoding); } catch (IllegalArgumentException e) { String m = e.getMessage(); String illegalSequence = m.substring(m.length() - 3, m.length() - 1); s = s.replaceAll("%" + illegalSequence, "%25" + illegalSequence); } } } }
RequestUtils { static String decode(String s, String encoding) throws UnsupportedEncodingException { s = StringUtils.trimToEmpty(s); while (true) { try { return URLDecoder.decode(s, encoding); } catch (IllegalArgumentException e) { String m = e.getMessage(); String illegalSequence = m.substring(m.length() - 3, m.length() - 1); s = s.replaceAll("%" + illegalSequence, "%25" + illegalSequence); } } } private  RequestUtils(); }
RequestUtils { static String decode(String s, String encoding) throws UnsupportedEncodingException { s = StringUtils.trimToEmpty(s); while (true) { try { return URLDecoder.decode(s, encoding); } catch (IllegalArgumentException e) { String m = e.getMessage(); String illegalSequence = m.substring(m.length() - 3, m.length() - 1); s = s.replaceAll("%" + illegalSequence, "%25" + illegalSequence); } } } private  RequestUtils(); static boolean containsAction(WebloungeRequest request); static String dumpHeaders(WebloungeRequest request); static String dumpParameters(WebloungeRequest request); static String getRequestedUrlExtension(WebloungeRequest request,
      Action action); static List<String> getRequestedUrlParams(WebloungeRequest request,
      Action action); static String getUrlExtension(WebloungeRequest request, Action action); static List<String> getUrlParams(WebloungeRequest request,
      Action action); static String getParameter(WebloungeRequest request, String parameter); static String getParameter(WebloungeRequest request, Action action,
      int index); static String getParameterWithDefault(WebloungeRequest request,
      String parameter, String defaultValue); static String getParameterWithDefault(WebloungeRequest request,
      Action action, int index, String defaultValue); static String getRequiredParameter(WebloungeRequest request,
      String parameter); static String getRequiredParameter(WebloungeRequest request,
      Action action, int parameter); static String getParameterWithDecoding(WebloungeRequest request,
      String parameter, String decoding); static boolean parameterExists(WebloungeRequest request,
      String parameter); static boolean parameterExists(WebloungeRequest request,
      Action action, int parameter); static short getShortParameter(WebloungeRequest request,
      String parameterName); static short getShortParameter(WebloungeRequest request,
      Action action, int parameter); static short getShortParameterWithDefault(WebloungeRequest request,
      String parameterName, short defaultValue); static short getShortParameterWithDefault(WebloungeRequest request,
      Action action, int index, short defaultValue); static short getRequiredShortParameter(WebloungeRequest request,
      String parameterName); static short getRequiredShortParameter(WebloungeRequest request,
      Action action, int index); static int getIntegerParameter(WebloungeRequest request,
      String parameterName); static int getIntegerParameterWithDefault(WebloungeRequest request,
      String parameterName, int defaultValue); static int getIntegerParameterWithDefault(WebloungeRequest request,
      Action action, int index, int defaultValue); static int getRequiredIntegerParameter(WebloungeRequest request,
      String parameterName); static int getRequiredIntegerParameter(WebloungeRequest request,
      Action action, int index); static long getLongParameter(WebloungeRequest request,
      String parameterName); static long getLongParameterWithDefault(WebloungeRequest request,
      String parameterName, long defaultValue); static long getLongParameterWithDefault(WebloungeRequest request,
      Action action, int index, long defaultValue); static long getRequiredLongParameter(WebloungeRequest request,
      String parameterName); static long getRequiredLongParameter(WebloungeRequest request,
      Action action, int index); static float getFloatParameter(WebloungeRequest request,
      String parameterName); static float getFloatParameterWithDefault(WebloungeRequest request,
      String parameterName, float defaultValue); static float getFloatParameterWithDefault(WebloungeRequest request,
      Action action, int index, float defaultValue); static float getRequiredFloatParameter(WebloungeRequest request,
      String parameterName); static float getRequiredFloatParameter(WebloungeRequest request,
      Action action, int index); static boolean getBooleanParameter(WebloungeRequest request,
      String parameterName); static boolean isEditingState(WebloungeRequest request); static boolean getBooleanParameterWithDefault(
      WebloungeRequest request, String parameterName, boolean defaultValue); static boolean getBooleanParameterWithDefault(
      WebloungeRequest request, Action action, int index, boolean defaultValue); static boolean getRequiredBooleanParameter(WebloungeRequest request,
      String parameterName); static boolean getRequiredBooleanParameter(WebloungeRequest request,
      Action action, int index); static Date getDateParameter(WebloungeRequest request,
      String parameterName); static Date getDateParameterWithDefault(WebloungeRequest request,
      String parameterName, Date defaultValue); static Date getDateParameterWithDefault(WebloungeRequest request,
      Action action, int index, Date defaultValue); static Date getRequiredDateParameter(WebloungeRequest request,
      String parameterName); static Date getRequiredDateParameter(WebloungeRequest request,
      Action action, int index); static void requireAny(WebloungeRequest request, String[] parameters); static boolean isMockRequest(ServletRequest request); static boolean isPrecompileRequest(ServletRequest request); static boolean isCausedByClient(IOException e); }
RequestUtils { static String decode(String s, String encoding) throws UnsupportedEncodingException { s = StringUtils.trimToEmpty(s); while (true) { try { return URLDecoder.decode(s, encoding); } catch (IllegalArgumentException e) { String m = e.getMessage(); String illegalSequence = m.substring(m.length() - 3, m.length() - 1); s = s.replaceAll("%" + illegalSequence, "%25" + illegalSequence); } } } private  RequestUtils(); static boolean containsAction(WebloungeRequest request); static String dumpHeaders(WebloungeRequest request); static String dumpParameters(WebloungeRequest request); static String getRequestedUrlExtension(WebloungeRequest request,
      Action action); static List<String> getRequestedUrlParams(WebloungeRequest request,
      Action action); static String getUrlExtension(WebloungeRequest request, Action action); static List<String> getUrlParams(WebloungeRequest request,
      Action action); static String getParameter(WebloungeRequest request, String parameter); static String getParameter(WebloungeRequest request, Action action,
      int index); static String getParameterWithDefault(WebloungeRequest request,
      String parameter, String defaultValue); static String getParameterWithDefault(WebloungeRequest request,
      Action action, int index, String defaultValue); static String getRequiredParameter(WebloungeRequest request,
      String parameter); static String getRequiredParameter(WebloungeRequest request,
      Action action, int parameter); static String getParameterWithDecoding(WebloungeRequest request,
      String parameter, String decoding); static boolean parameterExists(WebloungeRequest request,
      String parameter); static boolean parameterExists(WebloungeRequest request,
      Action action, int parameter); static short getShortParameter(WebloungeRequest request,
      String parameterName); static short getShortParameter(WebloungeRequest request,
      Action action, int parameter); static short getShortParameterWithDefault(WebloungeRequest request,
      String parameterName, short defaultValue); static short getShortParameterWithDefault(WebloungeRequest request,
      Action action, int index, short defaultValue); static short getRequiredShortParameter(WebloungeRequest request,
      String parameterName); static short getRequiredShortParameter(WebloungeRequest request,
      Action action, int index); static int getIntegerParameter(WebloungeRequest request,
      String parameterName); static int getIntegerParameterWithDefault(WebloungeRequest request,
      String parameterName, int defaultValue); static int getIntegerParameterWithDefault(WebloungeRequest request,
      Action action, int index, int defaultValue); static int getRequiredIntegerParameter(WebloungeRequest request,
      String parameterName); static int getRequiredIntegerParameter(WebloungeRequest request,
      Action action, int index); static long getLongParameter(WebloungeRequest request,
      String parameterName); static long getLongParameterWithDefault(WebloungeRequest request,
      String parameterName, long defaultValue); static long getLongParameterWithDefault(WebloungeRequest request,
      Action action, int index, long defaultValue); static long getRequiredLongParameter(WebloungeRequest request,
      String parameterName); static long getRequiredLongParameter(WebloungeRequest request,
      Action action, int index); static float getFloatParameter(WebloungeRequest request,
      String parameterName); static float getFloatParameterWithDefault(WebloungeRequest request,
      String parameterName, float defaultValue); static float getFloatParameterWithDefault(WebloungeRequest request,
      Action action, int index, float defaultValue); static float getRequiredFloatParameter(WebloungeRequest request,
      String parameterName); static float getRequiredFloatParameter(WebloungeRequest request,
      Action action, int index); static boolean getBooleanParameter(WebloungeRequest request,
      String parameterName); static boolean isEditingState(WebloungeRequest request); static boolean getBooleanParameterWithDefault(
      WebloungeRequest request, String parameterName, boolean defaultValue); static boolean getBooleanParameterWithDefault(
      WebloungeRequest request, Action action, int index, boolean defaultValue); static boolean getRequiredBooleanParameter(WebloungeRequest request,
      String parameterName); static boolean getRequiredBooleanParameter(WebloungeRequest request,
      Action action, int index); static Date getDateParameter(WebloungeRequest request,
      String parameterName); static Date getDateParameterWithDefault(WebloungeRequest request,
      String parameterName, Date defaultValue); static Date getDateParameterWithDefault(WebloungeRequest request,
      Action action, int index, Date defaultValue); static Date getRequiredDateParameter(WebloungeRequest request,
      String parameterName); static Date getRequiredDateParameter(WebloungeRequest request,
      Action action, int index); static void requireAny(WebloungeRequest request, String[] parameters); static boolean isMockRequest(ServletRequest request); static boolean isPrecompileRequest(ServletRequest request); static boolean isCausedByClient(IOException e);  }