Class IgnoreRule


  • @Deprecated
    public class IgnoreRule
    extends Object
    Deprecated.
    this rule does not support double star pattern and is slow parsing glob expressions. Consider to use FastIgnoreRule instead. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=440732
    A single ignore rule corresponding to one line in a .gitignore or ignore file. Parses the ignore pattern Inspiration from: Ferry Huberts
    • Constructor Detail

      • IgnoreRule

        public IgnoreRule​(String pattern)
        Deprecated.
        Create a new ignore rule with the given pattern. Assumes that the pattern is already trimmed.
        Parameters:
        pattern - Base pattern for the ignore rule. This pattern will be parsed to generate rule parameters.
    • Method Detail

      • getNameOnly

        public boolean getNameOnly()
        Deprecated.
        Returns:
        True if the pattern is just a file name and not a path
      • dirOnly

        public boolean dirOnly()
        Deprecated.
        Returns:
        True if the pattern should match directories only
      • getNegation

        public boolean getNegation()
        Deprecated.
        Returns:
        True if the pattern had a "!" in front of it
      • getPattern

        public String getPattern()
        Deprecated.
        Returns:
        The blob pattern to be used as a matcher
      • isMatch

        public boolean isMatch​(String target,
                               boolean isDirectory)
        Deprecated.
        Returns true if a match was made.
        This function does NOT return the actual ignore status of the target! Please consult getResult() for the ignore status. The actual ignore status may be true or false depending on whether this rule is an ignore rule or a negation rule.
        Parameters:
        target - Name pattern of the file, relative to the base directory of this rule
        isDirectory - Whether the target file is a directory or not
        Returns:
        True if a match was made. This does not necessarily mean that the target is ignored. Call getResult() for the result.
      • getResult

        public boolean getResult()
        Deprecated.
        If a call to isMatch(String, boolean) was previously made, this will return whether or not the target was ignored. Otherwise this just indicates whether the rule is non-negation or negation.
        Returns:
        True if the target is to be ignored, false otherwise.