Class PrefixPathMatcher

  • All Implemented Interfaces:
    PathMatcher

    @ThreadSafe
    public final class PrefixPathMatcher
    extends java.lang.Object
    implements PathMatcher
    A PathMatcher to match a path against a set of paths. Path a matches path b if a is the same as b or a is in the subtree of b. For example: /a/b/c matches /a/b, but /a/bc does not match /a/b because although /a/b is a prefix of /a/bc, /a/bc is not in the subtree of /a/b.
    • Constructor Summary

      Constructors 
      Constructor Description
      PrefixPathMatcher​(java.util.Set<java.lang.String> paths)
      Builds internal trie based on paths.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.util.List<java.lang.String>> match​(AlluxioURI path)  
      • Methods inherited from class java.lang.Object

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

      • PrefixPathMatcher

        public PrefixPathMatcher​(java.util.Set<java.lang.String> paths)
        Builds internal trie based on paths. Each path must start with "/".
        Parameters:
        paths - the list of path
    • Method Detail

      • match

        public java.util.Optional<java.util.List<java.lang.String>> match​(AlluxioURI path)
        Specified by:
        match in interface PathMatcher
        Parameters:
        path - the path to be matched, must start with "/"
        Returns:
        the list of matched path patterns sorted by descending match preferences