Class ParameterHelper
- java.lang.Object
-
- de.digitalcollections.cudami.server.controller.ParameterHelper
-
public class ParameterHelper extends Object
Extract parameters from a HttpServletRequest
-
-
Constructor Summary
Constructors Constructor Description ParameterHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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) colonstatic 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.
-
-
-
Method Detail
-
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
-
-