Class PathHelper


  • public class PathHelper
    extends Object
    A utility class for handling URI template parameters. As the Java regulare expressions package does not handle named groups, this class attempts to simulate that functionality by using groups.
    Author:
    Ryan J. McDonough, Bill Burke
    • Field Detail

      • URI_PARAM_PATTERN

        public static final Pattern URI_PARAM_PATTERN
      • URI_PARAM_WITH_REGEX_PATTERN

        public static final Pattern URI_PARAM_WITH_REGEX_PATTERN
      • URI_PARAM_WITHOUT_REGEX_PATTERN

        public static final Pattern URI_PARAM_WITHOUT_REGEX_PATTERN
      • URI_TEMPLATE_PATTERN

        public static final Pattern URI_TEMPLATE_PATTERN
        A regex pattern that searches for a URI template parameter in the form of {*}
    • Constructor Detail

      • PathHelper

        public PathHelper()
    • Method Detail

      • getEncodedPathInfo

        public static String getEncodedPathInfo​(String path,
                                                String contextPath)
      • replaceEnclosedCurlyBraces

        public static String replaceEnclosedCurlyBraces​(String str)
      • replaceEnclosedCurlyBracesCS

        public static CharSequence replaceEnclosedCurlyBracesCS​(String str)
        A cheaper (memory-wise) version of replaceEnclosedCurlyBraces(String str).
        Parameters:
        str - input string
        Returns:
        replaced output
      • recoverEnclosedCurlyBraces

        public static String recoverEnclosedCurlyBraces​(String str)