类 HelmIgnorePathMatcher
- java.lang.Object
-
- org.microbean.helm.chart.HelmIgnorePathMatcher
-
- 所有已实现的接口:
PathMatcher,Predicate<Path>
public class HelmIgnorePathMatcher extends Object implements PathMatcher, Predicate<Path>
APathMatcherand aPredicate<Path>that matches paths using the syntax of a.helmignorefile.This class passes all of the unit tests present in the Helm project's package concerned with
.helmignorefiles. It may permit richer syntax, but there are no guarantees made regarding the behavior of this class in such cases.Thread Safety
This class is safe for concurrent use by multiple threads.
-
-
构造器概要
构造器 构造器 说明 HelmIgnorePathMatcher()Creates a newHelmIgnorePathMatcher.HelmIgnorePathMatcher(Reader reader)Creates a newHelmIgnorePathMatcher.HelmIgnorePathMatcher(Path helmIgnoreFile)Creates a newHelmIgnorePathMatcher.HelmIgnorePathMatcher(Collection<? extends String> stringPatterns)Creates a newHelmIgnorePathMatcher.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddPattern(String stringPattern)Calls theaddPatterns(Collection)method with a singletonSetconsisting of the suppliedstringPattern.voidaddPatterns(Collection<? extends String> stringPatterns)Adds all of the valid.helmignorepatterns present in the suppliedCollectionof such patterns.booleanmatches(Path path)Returnstrueif the suppliedPathis neithernull, the empty path ("") nor the "current directory" path ("." or "./"), and if at least one of the patterns added via theaddPatterns(Collection)method logically matches it.booleantest(Path path)Calls thematches(Path)method with the suppliedPathand returns its results.
-
-
-
构造器详细资料
-
HelmIgnorePathMatcher
public HelmIgnorePathMatcher()
Creates a newHelmIgnorePathMatcher.
-
HelmIgnorePathMatcher
public HelmIgnorePathMatcher(Collection<? extends String> stringPatterns)
Creates a newHelmIgnorePathMatcher.- 参数:
stringPatterns- aCollectionof valid.helmignorepatterns; may benull- 抛出:
PatternSyntaxException- if any of the patterns is invalid
-
HelmIgnorePathMatcher
public HelmIgnorePathMatcher(Reader reader) throws IOException
Creates a newHelmIgnorePathMatcher.- 参数:
reader- aReaderexpected to provide access to a logical collection of lines of text, each line of which is a valid.helmignorepattern (or blank line, or comment); may benull; never closed- 抛出:
IOException- if an error related to the suppliedreaderis encounteredPatternSyntaxException- if any of the patterns is invalid
-
HelmIgnorePathMatcher
public HelmIgnorePathMatcher(Path helmIgnoreFile) throws IOException
Creates a newHelmIgnorePathMatcher.- 参数:
helmIgnoreFile- aPathexpected to provide access to a logical collection of lines of text, each line of which is a valid.helmignorepattern (or blank line, or comment); may benull; never closed- 抛出:
IOException- if an error related to the suppliedhelmIgnoreFileis encounteredPatternSyntaxException- if any of the patterns is invalid- 另请参阅:
HelmIgnorePathMatcher(Reader)
-
-
方法详细资料
-
addPattern
public final void addPattern(String stringPattern)
Calls theaddPatterns(Collection)method with a singletonSetconsisting of the suppliedstringPattern.- 参数:
stringPattern- a valid.helmignorepattern; may benullor empty or prefixed with a#character, in which case no action will be taken- 另请参阅:
addPatterns(Collection),matches(Path)
-
addPatterns
public void addPatterns(Collection<? extends String> stringPatterns)
Adds all of the valid.helmignorepatterns present in the suppliedCollectionof such patterns.Overrides must not call
addPattern(String).- 参数:
stringPatterns- aCollectionof valid.helmignorepatterns; may benullin which case no action will be taken- 另请参阅:
matches(Path)
-
test
public final boolean test(Path path)
Calls thematches(Path)method with the suppliedPathand returns its results.- 指定者:
test在接口中Predicate<Path>- 参数:
path- aPathto test; may benull- 返回:
trueif the suppliedpathmatches;falseotherwise- 另请参阅:
matches(Path)
-
matches
public boolean matches(Path path)
Returnstrueif the suppliedPathis neithernull, the empty path ("") nor the "current directory" path ("." or "./"), and if at least one of the patterns added via theaddPatterns(Collection)method logically matches it.- 指定者:
matches在接口中PathMatcher- 参数:
path- thePathto match; may benullin which casefalsewill be returned- 返回:
trueif at least one of the patterns added via theaddPatterns(Collection)method logically matches the suppliedPath;falseotherwise
-
-