public class IgnoreNode
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
IgnoreNode.MatchResult
Result from
isIgnored(String, boolean) . |
Modifier and Type | Field and Description |
---|---|
private java.util.List<FastIgnoreRule> |
rules
The rules that have been parsed into this node.
|
Constructor and Description |
---|
IgnoreNode()
Create an empty ignore node with no rules.
|
IgnoreNode(java.util.List<FastIgnoreRule> rules)
Create an ignore node with given rules.
|
Modifier and Type | Method and Description |
---|---|
private static java.io.BufferedReader |
asReader(java.io.InputStream in) |
java.lang.Boolean |
checkIgnored(java.lang.String entryPath,
boolean isDirectory)
Determine if an entry path matches an ignore rule.
|
java.util.List<FastIgnoreRule> |
getRules()
Get list of all ignore rules held by this node
|
IgnoreNode.MatchResult |
isIgnored(java.lang.String entryPath,
boolean isDirectory)
Determine if an entry path matches an ignore rule.
|
void |
parse(java.io.InputStream in)
Parse files according to gitignore standards.
|
java.lang.String |
toString() |
private final java.util.List<FastIgnoreRule> rules
public IgnoreNode()
public IgnoreNode(java.util.List<FastIgnoreRule> rules)
rules
- list of rules.public void parse(java.io.InputStream in) throws java.io.IOException
in
- input stream holding the standard ignore format. The caller is
responsible for closing the stream.java.io.IOException
- Error thrown when reading an ignore file.private static java.io.BufferedReader asReader(java.io.InputStream in)
public java.util.List<FastIgnoreRule> getRules()
public IgnoreNode.MatchResult isIgnored(java.lang.String entryPath, boolean isDirectory)
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.public java.lang.Boolean checkIgnored(java.lang.String entryPath, boolean isDirectory)
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.public java.lang.String toString()
toString
in class java.lang.Object