Class ParameterHelper

java.lang.Object
de.digitalcollections.cudami.admin.controller.ParameterHelper

public class ParameterHelper extends Object
Extract parameters from a HttpServletRequest
  • Field Details

  • 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 evaluated
      leadingPathRegex - 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

      public static org.apache.commons.lang3.tuple.Triple<String,String,String> extractTripleOfStringsFromUri(String requestUri, String leadingPathRegex)
    • extractTripleOfStrings

      public static org.apache.commons.lang3.tuple.Triple<String,String,String> extractTripleOfStrings(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