@Test public void filteredGetParameterMap() { when(req.getParameterMap()).thenReturn(UtilMisc.toMap( "foo", new String[] {"1"}, "bar", new String[] {"2", "3"})); when(req.getPathInfo()).thenReturn("/foo"); Predicate<String> equalsBar = "bar"::equals; assertThat(UtilHttp.getParameterMap(req, equalsBar.negate()), Matchers.<Map<String, Object>>allOf( hasEntry("foo", "1"), not(hasEntry("bar", Arrays.asList("2", "3"))))); assertThat(UtilHttp.getParameterMap(req, equalsBar), Matchers.<Map<String, Object>>allOf( not(hasEntry("foo", "1")), hasEntry("bar", Arrays.asList("2", "3")))); }
public static Map<String, Object> getParameterMap(HttpServletRequest request) { return getParameterMap(request, x -> true); }
UtilHttp { public static Map<String, Object> getParameterMap(HttpServletRequest request) { return getParameterMap(request, x -> true); } }
UtilHttp { public static Map<String, Object> getParameterMap(HttpServletRequest request) { return getParameterMap(request, x -> true); } private  UtilHttp(); }
UtilHttp { public static Map<String, Object> getParameterMap(HttpServletRequest request) { return getParameterMap(request, x -> true); } private  UtilHttp(); static Map<String, Object> getCombinedMap(HttpServletRequest request); static Map<String, Object> getCombinedMap(HttpServletRequest request, Set<? extends String> namesToSkip); static Map<String, Object> getParameterMap(HttpServletRequest request); static Map<String, Object> getParameterMap(HttpServletRequest req, Predicate<String> pred); static Map<String, Object> getMultiPartParameterMap(HttpServletRequest request); static long getMaxUploadSize(Delegator delegator); static int getSizeThreshold(Delegator delegator); static File getTmpUploadRepository(Delegator delegator); static Map<String, Object> getQueryStringOnlyParameterMap(String queryString); static Map<String, Object> getUrlOnlyParameterMap(HttpServletRequest request); static Map<String, Object> canonicalizeParameterMap(Map<String, Object> paramMap); static String canonicalizeParameter(String paramValue); static Map<String, Object> getJSONAttributeMap(HttpServletRequest request); static Map<String, Object> getAttributeMap(HttpServletRequest request); static Map<String, Object> getAttributeMap(HttpServletRequest request, Set<? extends String> namesToSkip); static Map<String, Object> getSessionMap(HttpServletRequest request); static Map<String, Object> getSessionMap(HttpServletRequest request, Set<? extends String> namesToSkip); static Map<String, Object> getServletContextMap(HttpServletRequest request); static Map<String, Object> getServletContextMap(HttpServletRequest request, Set<? extends String> namesToSkip); static Map<String, Object> makeParamMapWithPrefix(HttpServletRequest request, String prefix, String suffix); static Map<String, Object> makeParamMapWithPrefix(HttpServletRequest request, Map<String, ? extends Object> additionalFields,
                                                             String prefix, String suffix); static Map<String, Object> makeParamMapWithPrefix(Map<String, ? extends Object> context, Map<String, ? extends Object> additionalFields,
                                                             String prefix, String suffix); static List<Object> makeParamListWithSuffix(HttpServletRequest request, String suffix, String prefix); static List<Object> makeParamListWithSuffix(HttpServletRequest request, Map<String, ?> additionalFields,
                                                       String suffix, String prefix); static String getApplicationName(HttpServletRequest request); static void setInitialRequestInfo(HttpServletRequest request); static String getServerRootUrl(HttpServletRequest request); static String getFullRequestUrl(HttpServletRequest request); static String getRequestMethod(HttpServletRequest request); static Locale getLocale(HttpServletRequest request, HttpSession session, Object appDefaultLocale); static Locale getLocale(HttpServletRequest request); static Locale getLocale(HttpSession session); static void setLocale(HttpServletRequest request, String localeString); static void setLocale(HttpSession session, Locale locale); static void setLocaleIfNone(HttpSession session, String localeString); static void setTimeZone(HttpServletRequest request, String tzId); static void setTimeZone(HttpSession session, TimeZone timeZone); static void setTimeZoneIfNone(HttpSession session, String timeZoneString); static TimeZone getTimeZone(HttpServletRequest request); static TimeZone getTimeZone(HttpServletRequest request, HttpSession session, String appDefaultTimeZoneString); static VisualTheme getVisualTheme(HttpServletRequest request); static void setVisualTheme(HttpServletRequest request, VisualTheme visualTheme); static void setVisualTheme(HttpSession session, VisualTheme visualTheme); static String getCurrencyUom(HttpSession session, String appDefaultCurrencyUom); static String getCurrencyUom(HttpServletRequest request); static void setCurrencyUom(HttpSession session, String currencyUom); static void setCurrencyUomIfNone(HttpSession session, String currencyUom); static String urlEncodeArgs(Map<String, ? extends Object> args); static String urlEncodeArgs(Map<String, ? extends Object> args, boolean useExpandedEntites); static String urlEncodeArgs(Map<String, ? extends Object> args, boolean useExpandedEntites, boolean preserveEmpty); static String getEncodedParameter(String parameter); static String getRequestUriFromTarget(String target); static String getQueryStringFromTarget(String target); static String removeQueryStringFromTarget(String target); static String getWebappMountPointFromTarget(String target); static String encodeAmpersands(String htmlString); static String encodeBlanks(String htmlString); static String setResponseBrowserProxyNoCache(HttpServletRequest request, HttpServletResponse response); static void setResponseBrowserProxyNoCache(HttpServletResponse response); static void setResponseBrowserDefaultSecurityHeaders(HttpServletResponse resp, ConfigXMLReader.ViewMap viewMap); static String getContentTypeByFileName(String fileName); static void streamContentToBrowser(HttpServletResponse response, byte[] bytes, String contentType, String fileName); static void streamContentToBrowser(HttpServletResponse response, byte[] bytes, String contentType); static void streamContentToBrowser(HttpServletResponse response, InputStream in, int length, String contentType, String fileName); static void streamContentToBrowser(HttpServletResponse response, InputStream in, int length, String contentType); static void streamContent(OutputStream out, InputStream in, int length); static String stripViewParamsFromQueryString(String queryString); static String stripViewParamsFromQueryString(String queryString, String paginatorNumber); static String stripNamedParamsFromQueryString(String queryString, Collection<String> paramNames); static Collection<Map<String, Object>> parseMultiFormData(Map<String, Object> parameters); static Map<String, V> removeMultiFormParameters(Map<String, V> parameters); static String makeCompositeParam(String prefix, String suffix); static Object makeParamValueFromComposite(HttpServletRequest request, String prefix); static String getSessionId(HttpServletRequest request); static boolean isJavaScriptEnabled(HttpServletRequest request); static int getMultiFormRowCount(HttpServletRequest request); static int getMultiFormRowCount(Map<String, ?> requestMap); static String stashParameterMap(HttpServletRequest request); static void restoreStashedParameterMap(HttpServletRequest request, String paramMapId); static String getNextUniqueId(HttpServletRequest request); static void setContentDisposition(final HttpServletResponse response, final String filename); static CloseableHttpClient getAllowAllHttpClient(); static CloseableHttpClient getAllowAllHttpClient(String jksStoreFileName, String jksStorePassword); static String getMultiRowDelimiter(); static String getRowSubmitPrefix(); }
UtilHttp { public static Map<String, Object> getParameterMap(HttpServletRequest request) { return getParameterMap(request, x -> true); } private  UtilHttp(); static Map<String, Object> getCombinedMap(HttpServletRequest request); static Map<String, Object> getCombinedMap(HttpServletRequest request, Set<? extends String> namesToSkip); static Map<String, Object> getParameterMap(HttpServletRequest request); static Map<String, Object> getParameterMap(HttpServletRequest req, Predicate<String> pred); static Map<String, Object> getMultiPartParameterMap(HttpServletRequest request); static long getMaxUploadSize(Delegator delegator); static int getSizeThreshold(Delegator delegator); static File getTmpUploadRepository(Delegator delegator); static Map<String, Object> getQueryStringOnlyParameterMap(String queryString); static Map<String, Object> getUrlOnlyParameterMap(HttpServletRequest request); static Map<String, Object> canonicalizeParameterMap(Map<String, Object> paramMap); static String canonicalizeParameter(String paramValue); static Map<String, Object> getJSONAttributeMap(HttpServletRequest request); static Map<String, Object> getAttributeMap(HttpServletRequest request); static Map<String, Object> getAttributeMap(HttpServletRequest request, Set<? extends String> namesToSkip); static Map<String, Object> getSessionMap(HttpServletRequest request); static Map<String, Object> getSessionMap(HttpServletRequest request, Set<? extends String> namesToSkip); static Map<String, Object> getServletContextMap(HttpServletRequest request); static Map<String, Object> getServletContextMap(HttpServletRequest request, Set<? extends String> namesToSkip); static Map<String, Object> makeParamMapWithPrefix(HttpServletRequest request, String prefix, String suffix); static Map<String, Object> makeParamMapWithPrefix(HttpServletRequest request, Map<String, ? extends Object> additionalFields,
                                                             String prefix, String suffix); static Map<String, Object> makeParamMapWithPrefix(Map<String, ? extends Object> context, Map<String, ? extends Object> additionalFields,
                                                             String prefix, String suffix); static List<Object> makeParamListWithSuffix(HttpServletRequest request, String suffix, String prefix); static List<Object> makeParamListWithSuffix(HttpServletRequest request, Map<String, ?> additionalFields,
                                                       String suffix, String prefix); static String getApplicationName(HttpServletRequest request); static void setInitialRequestInfo(HttpServletRequest request); static String getServerRootUrl(HttpServletRequest request); static String getFullRequestUrl(HttpServletRequest request); static String getRequestMethod(HttpServletRequest request); static Locale getLocale(HttpServletRequest request, HttpSession session, Object appDefaultLocale); static Locale getLocale(HttpServletRequest request); static Locale getLocale(HttpSession session); static void setLocale(HttpServletRequest request, String localeString); static void setLocale(HttpSession session, Locale locale); static void setLocaleIfNone(HttpSession session, String localeString); static void setTimeZone(HttpServletRequest request, String tzId); static void setTimeZone(HttpSession session, TimeZone timeZone); static void setTimeZoneIfNone(HttpSession session, String timeZoneString); static TimeZone getTimeZone(HttpServletRequest request); static TimeZone getTimeZone(HttpServletRequest request, HttpSession session, String appDefaultTimeZoneString); static VisualTheme getVisualTheme(HttpServletRequest request); static void setVisualTheme(HttpServletRequest request, VisualTheme visualTheme); static void setVisualTheme(HttpSession session, VisualTheme visualTheme); static String getCurrencyUom(HttpSession session, String appDefaultCurrencyUom); static String getCurrencyUom(HttpServletRequest request); static void setCurrencyUom(HttpSession session, String currencyUom); static void setCurrencyUomIfNone(HttpSession session, String currencyUom); static String urlEncodeArgs(Map<String, ? extends Object> args); static String urlEncodeArgs(Map<String, ? extends Object> args, boolean useExpandedEntites); static String urlEncodeArgs(Map<String, ? extends Object> args, boolean useExpandedEntites, boolean preserveEmpty); static String getEncodedParameter(String parameter); static String getRequestUriFromTarget(String target); static String getQueryStringFromTarget(String target); static String removeQueryStringFromTarget(String target); static String getWebappMountPointFromTarget(String target); static String encodeAmpersands(String htmlString); static String encodeBlanks(String htmlString); static String setResponseBrowserProxyNoCache(HttpServletRequest request, HttpServletResponse response); static void setResponseBrowserProxyNoCache(HttpServletResponse response); static void setResponseBrowserDefaultSecurityHeaders(HttpServletResponse resp, ConfigXMLReader.ViewMap viewMap); static String getContentTypeByFileName(String fileName); static void streamContentToBrowser(HttpServletResponse response, byte[] bytes, String contentType, String fileName); static void streamContentToBrowser(HttpServletResponse response, byte[] bytes, String contentType); static void streamContentToBrowser(HttpServletResponse response, InputStream in, int length, String contentType, String fileName); static void streamContentToBrowser(HttpServletResponse response, InputStream in, int length, String contentType); static void streamContent(OutputStream out, InputStream in, int length); static String stripViewParamsFromQueryString(String queryString); static String stripViewParamsFromQueryString(String queryString, String paginatorNumber); static String stripNamedParamsFromQueryString(String queryString, Collection<String> paramNames); static Collection<Map<String, Object>> parseMultiFormData(Map<String, Object> parameters); static Map<String, V> removeMultiFormParameters(Map<String, V> parameters); static String makeCompositeParam(String prefix, String suffix); static Object makeParamValueFromComposite(HttpServletRequest request, String prefix); static String getSessionId(HttpServletRequest request); static boolean isJavaScriptEnabled(HttpServletRequest request); static int getMultiFormRowCount(HttpServletRequest request); static int getMultiFormRowCount(Map<String, ?> requestMap); static String stashParameterMap(HttpServletRequest request); static void restoreStashedParameterMap(HttpServletRequest request, String paramMapId); static String getNextUniqueId(HttpServletRequest request); static void setContentDisposition(final HttpServletResponse response, final String filename); static CloseableHttpClient getAllowAllHttpClient(); static CloseableHttpClient getAllowAllHttpClient(String jksStoreFileName, String jksStorePassword); static String getMultiRowDelimiter(); static String getRowSubmitPrefix();  }