Class Paths

  • public class Paths
    extends java.lang.Object
    • Field Summary

      Modifier and Type Field Description
      static java.lang.String ROOT  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String contextPath​(java.lang.String contextPath)  
      static java.lang.String firstPathSegment​(java.lang.String path)  
      static java.lang.String maybeChompLeadingSlash​(java.lang.String path)  
      static java.lang.String maybeChompTrailingSlash​(java.lang.String path)  
      static java.lang.String removeAdjacentForwardSlashes​(java.lang.String candidate)  
      static java.lang.String rootPathWhenEmpty​(java.lang.String path)  
      static java.lang.String sanitizeRequestMappingPattern​(java.lang.String requestMappingPattern)
      Gets a uri friendly path from a request mapping pattern.
      static java.lang.String splitCamelCase​(java.lang.String s, java.lang.String separator)  
      static java.lang.String stripSlashes​(java.lang.String stringWithSlashes)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • splitCamelCase

        public static java.lang.String splitCamelCase​(java.lang.String s,
                                                      java.lang.String separator)
      • stripSlashes

        public static java.lang.String stripSlashes​(java.lang.String stringWithSlashes)
      • maybeChompLeadingSlash

        public static java.lang.String maybeChompLeadingSlash​(java.lang.String path)
      • maybeChompTrailingSlash

        public static java.lang.String maybeChompTrailingSlash​(java.lang.String path)
      • firstPathSegment

        public static java.lang.String firstPathSegment​(java.lang.String path)
      • sanitizeRequestMappingPattern

        public static java.lang.String sanitizeRequestMappingPattern​(java.lang.String requestMappingPattern)
        Gets a uri friendly path from a request mapping pattern. Typically involves removing any regex patterns or || conditions from a spring request mapping This method will be called to resolve every request mapping endpoint. A good extension point if you need to alter endpoints by adding or removing path segments. Note: this should not be an absolute uri
        requestMappingPattern - request mapping pattern
        the request mapping endpoint
      • removeAdjacentForwardSlashes

        public static java.lang.String removeAdjacentForwardSlashes​(java.lang.String candidate)
      • contextPath

        public static java.lang.String contextPath​(java.lang.String contextPath)
      • rootPathWhenEmpty

        public static java.lang.String rootPathWhenEmpty​(java.lang.String path)