Class ParameterHelper
java.lang.Object
de.digitalcollections.cudami.admin.controller.ParameterHelper
Extract parameters from a HttpServletRequest
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionextractPairOfStrings
(String string) Extract a pair of strings from a string, separated by a (the first) colonextractPairOfStringsFromUri
(String requestUri, String leadingPathRegex) Extract a pair of strings from the path of an HttpRequest, separated by a (the first) colon.extractTripleOfStrings
(String string) Extract a triple of strings from a string, separated by a (the first and second) colonextractTripleOfStringsFromUri
(String requestUri, String leadingPathRegex)
-
Field Details
-
UUID_PATTERN
- See Also:
-
-
Constructor Details
-
ParameterHelper
public ParameterHelper()
-
-
Method Details
-
extractPairOfStringsFromUri
public static org.apache.commons.lang3.tuple.Pair<String,String> extractPairOfStringsFromUri(String requestUri, String leadingPathRegex) Extract a pair of strings from the path of an HttpRequest, separated by a (the first) colon.The HttpRequest can be either plaintext (should not contain slashes) or BASE64 encoded.
If the request string ends with .json, that string is cut off.
- Parameters:
requestUri
- the URI whose path is evaluatedleadingPathRegex
- the regex, at whose end the evaulation will start- Returns:
- a pair of strings, separated by the first colon. The second string can contain multiple colons
-
extractPairOfStrings
public static org.apache.commons.lang3.tuple.Pair<String,String> extractPairOfStrings(String string) Extract a pair of strings from a string, separated by a (the first) colon- Parameters:
string
- the string- Returns:
- a pair of strings, separated by the first colon. The second string can contain multiple * colons
-
extractTripleOfStringsFromUri
-
extractTripleOfStrings
public static org.apache.commons.lang3.tuple.Triple<String,String, extractTripleOfStringsString> (String string) Extract a triple of strings from a string, separated by a (the first and second) colon- Parameters:
string
- the string- Returns:
- a triple of strings, separated by the first and second colon. The third string can contain multiple * colons
-