Package com.predic8.membrane.core.util
Class URLParamUtil
java.lang.Object
com.predic8.membrane.core.util.URLParamUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateQueryString(String... params) static Stringstatic intgetIntParam(URIFactory uriFactory, Exchange exc, String name) getParams(URIFactory uriFactory, Exchange exc, URLParamUtil.DuplicateKeyOrInvalidFormStrategy duplicateKeyOrInvalidFormStrategy) static StringgetStringParam(URIFactory uriFactory, Exchange exc, String name) static booleanhasNoFormParams(Exchange exc) parseQueryString(String query, URLParamUtil.DuplicateKeyOrInvalidFormStrategy duplicateKeyOrInvalidFormStrategy) Parse a URL query into parameter pairs.
-
Constructor Details
-
URLParamUtil
public URLParamUtil()
-
-
Method Details
-
getParams
public static Map<String,String> getParams(URIFactory uriFactory, Exchange exc, URLParamUtil.DuplicateKeyOrInvalidFormStrategy duplicateKeyOrInvalidFormStrategy) throws Exception - Throws:
Exception
-
getStringParam
public static String getStringParam(URIFactory uriFactory, Exchange exc, String name) throws Exception - Throws:
Exception
-
getIntParam
- Throws:
Exception
-
hasNoFormParams
- Throws:
IOException
-
createQueryString
-
parseQueryString
public static Map<String,String> parseQueryString(String query, URLParamUtil.DuplicateKeyOrInvalidFormStrategy duplicateKeyOrInvalidFormStrategy) Parse a URL query into parameter pairs. The query is expected to be application/x-www-form-urlencoded .Note that this method does not really support multiple parameters with the same key. This method should therefore only be used in contexts where this is not an issue.
Background: Note that according to the original RFC 3986 Section 3.4, there is no defined format of the query string.
HTML5 defines in form-submission how HTML forms should be serialized. The URLSearchParams class behaviour is defined in URLSearchParams where handling of parameters with the same key is supported.
-
encode
-