Package org.eclipse.jgit.ignore
Class IgnoreNode
java.lang.Object
org.eclipse.jgit.ignore.IgnoreNode
- Direct Known Subclasses:
WorkingTreeIterator.PerDirectoryIgnoreNode
Represents a bundle of ignore rules inherited from a base directory.
This class is not thread safe, it maintains state about the last match.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private final List<FastIgnoreRule>
The rules that have been parsed into this node. -
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty ignore node with no rules.IgnoreNode
(List<FastIgnoreRule> rules) Create an ignore node with given rules. -
Method Summary
Modifier and TypeMethodDescriptionprivate static BufferedReader
asReader
(InputStream in) checkIgnored
(String entryPath, boolean isDirectory) Determine if an entry path matches an ignore rule.getRules()
Get list of all ignore rules held by this nodeDetermine if an entry path matches an ignore rule.void
parse
(InputStream in) Parse files according to gitignore standards.void
parse
(String sourceName, InputStream in) Parse files according to gitignore standards.toString()
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
rules
The rules that have been parsed into this node.
-
-
Constructor Details
-
IgnoreNode
public IgnoreNode()Create an empty ignore node with no rules. -
IgnoreNode
Create an ignore node with given rules.- Parameters:
rules
- list of rules.
-
-
Method Details
-
parse
Parse files according to gitignore standards.- Parameters:
in
- input stream holding the standard ignore format. The caller is responsible for closing the stream.- Throws:
IOException
- Error thrown when reading an ignore file.
-
parse
Parse files according to gitignore standards.- Parameters:
sourceName
- identifying the source of the streamin
- input stream holding the standard ignore format. The caller is responsible for closing the stream.- Throws:
IOException
- Error thrown when reading an ignore file.- Since:
- 5.11
-
asReader
-
getRules
Get list of all ignore rules held by this node- Returns:
- list of all ignore rules held by this node
-
isIgnored
Determine if an entry path matches an ignore rule.- Parameters:
entryPath
- the path to test. The path must be relative to this ignore node's own repository path, and in repository path format (uses '/' and not '\').isDirectory
- true if the target item is a directory.- Returns:
- status of the path.
-
checkIgnored
Determine if an entry path matches an ignore rule.- Parameters:
entryPath
- the path to test. The path must be relative to this ignore node's own repository path, and in repository path format (uses '/' and not '\').isDirectory
- true if the target item is a directory.- Returns:
- Boolean.TRUE, if the entry is ignored; Boolean.FALSE, if the entry is forced to be not ignored (negated match); or null, if undetermined
- Since:
- 4.11
-
toString
-