Class SimplePathMapping

  • All Implemented Interfaces:
    PathMapping

    public class SimplePathMapping
    extends java.lang.Object
    implements PathMapping
    Implements a simple path mapping that strips and prefixes a path.
    Since:
    2.4.10
    • Constructor Summary

      Constructors 
      Constructor Description
      SimplePathMapping​(java.lang.String strip, java.lang.String root)
      Create a simple path mapping.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String map​(java.lang.String path)
      Maps the given path to a new location.
      java.lang.String map​(java.lang.String path, boolean reverse)
      Maps the given path to a new location.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimplePathMapping

        public SimplePathMapping​(@Nonnull
                                 java.lang.String strip,
                                 @Nonnull
                                 java.lang.String root)
        Create a simple path mapping.
        Parameters:
        strip - the string to strip from the beginning of the path
        root - the prefix to add to the path.
    • Method Detail

      • map

        @Nonnull
        public java.lang.String map​(@Nonnull
                                    java.lang.String path)
        Maps the given path to a new location.
        Specified by:
        map in interface PathMapping
        Parameters:
        path - the path
        Returns:
        the mapped path.
      • map

        @Nonnull
        public java.lang.String map​(@Nonnull
                                    java.lang.String path,
                                    boolean reverse)
        Maps the given path to a new location.
        Specified by:
        map in interface PathMapping
        Parameters:
        path - the path
        reverse - if true a reverse mapping is applied
        Returns:
        the mapped path.