Class SearchPattern.PatternPart

  • Enclosing class:
    SearchPattern

    public class SearchPattern.PatternPart
    extends Object

    Represents the part of pattern during search as we narrow it down during traversing through the path tree.

    Every SearchPattern can contain one or more Parts. Basically part is a search pattern without first N elements. As soon as we meet first '**' we don't create new parts, but use existing one, since '**' matches all files recursively

    • Method Detail

      • getPatternString

        public String getPatternString()
        Returns:
        the pattern string the object was initialized with. Doesn't contain include/exclude tag.
      • containsWildcard

        public boolean containsWildcard()
        Indicates whether the pattern is precise (i.e. no wildcards '*' and '?')
        Returns:
        true, when pattern is precise
      • isExhausted

        public boolean isExhausted()
        Indicates whether the pattern is exhausted (i.e. contains no data)
        Returns:
        true when pattern is exhausted
      • getCurrentPiece

        public String getCurrentPiece()
        Returns:
        current path piece pattern
      • matches

        public boolean matches​(@NotNull
                               List<String> path)
      • matches

        public boolean matches​(@NotNull
                               List<String> path,
                               @NotNull
                               String lastPathPart)
      • find

        public boolean find​(String filename)
        Checks whether the beginning of the pattern matches the file, so we can continue traversing down
        Parameters:
        filename - filename or subpattern token to check against
        Returns:
        true if matched
        false otherwise
      • matchesAllInside

        public boolean matchesAllInside​(@NotNull
                                        String folderName)
        Checks whether this pattern part matches all files within a certain folder
        Parameters:
        folderName - folder name to check
        Returns:
        true if pattern part matches all files (recursively) within this folder
        false otherwise
      • getNextState

        public SearchPattern.PatternPart getNextState()
        Returns:
        next path piece when traversing down throw the tree
      • getRuleType

        public jetbrains.buildServer.util.pathMatcher.RuleType getRuleType()
        Returns:
        SearchPattern's rule type (INCLUDE or EXCLUDE)