Class DefaultPathFilter

    • Method Detail

      • setPattern

        public void setPattern​(String pattern)
                        throws ConfigurationException
        Sets the regexp pattern for this filter. Examples:
         | Pattern        | Matches
         | /foo           | exactly "/foo"
         | /foo.*         | all paths starting with "/foo"
         | ^.* /foo[^/]*$ | all files starting with "foo"
         | /foo/[^/]*$    | all direct children of /foo
         | /foo/.*        | all children of /foo
         | /foo(/.*)?     | all children of /foo and foo itself
         
        Parameters:
        pattern - the pattern.
        Throws:
        ConfigurationException - in case an invalid regex pattern was given.
      • getPattern

        public String getPattern()
        Returns the pattern
        Returns:
        the pattern
      • matches

        public boolean matches​(String path)
        Checks if the given path matches this filters criteria.
        Specified by:
        matches in interface PathFilter
        Parameters:
        path - the path to check
        Returns:
        true if this filter matches the criteria; false otherwise.
      • isAbsolute

        public boolean isAbsolute()
        Checks if the pattern is absolute, i.e. does not start with a wildcard.
        Specified by:
        isAbsolute in interface PathFilter
        Returns:
        true if pattern is absolute
      • translate

        public PathFilter translate​(PathMapping mapping)
        Translates this path filter with the given mapping. Note that only absolute filters can be translated.
        Specified by:
        translate in interface PathFilter
        Parameters:
        mapping - the mapping to apply
        Returns:
        the new filter
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • dump

        public void dump​(DumpContext ctx,
                         boolean isLast)
        Dumps some human readable information using the given context.
        Specified by:
        dump in interface Dumpable
        Parameters:
        ctx - the dump context
        isLast - specifies if this is the last element to dump on this level