public abstract class FileRuleSet<IncludeRuleClass extends FileRule,ExcludeRuleClass extends FileRule>
extends java.lang.Object
implements jetbrains.buildServer.log.Loggable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXCLUDE_PREFIX |
static java.lang.String |
IGNORE_CASE_MARK |
static java.lang.String |
INCLUDE_PREFIX |
Constructor and Description |
---|
FileRuleSet(java.util.List<IncludeRuleClass> includeRules,
java.util.List<ExcludeRuleClass> excludeRules) |
FileRuleSet(java.util.List<java.lang.String> lines) |
FileRuleSet(java.lang.String body) |
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.String> |
convertToLines(java.lang.String body)
Accepts string and transforms it to the list of lines which can be passed to the
FileRuleSet(List) constructor |
protected abstract ExcludeRuleClass |
createNewExcludeRule(ExcludeRuleClass includeRule) |
protected abstract ExcludeRuleClass |
createNewExcludeRule(java.lang.String line) |
protected abstract IncludeRuleClass |
createNewIncludeRule(IncludeRuleClass includeRule) |
protected abstract IncludeRuleClass |
createNewIncludeRule(java.lang.String rule) |
protected Filter<FileRule> |
createPropertiesFilter(java.util.Map<java.lang.String,java.lang.String> props) |
java.lang.String |
describe(boolean verbose) |
protected abstract void |
doPostInitProcess(java.util.List<IncludeRuleClass> includeRules,
java.util.List<ExcludeRuleClass> excludeRules) |
boolean |
equals(java.lang.Object o) |
protected static <T extends FileRule> |
findMostSpecific(java.lang.String path,
java.util.List<T> rules) |
java.util.List<java.lang.String> |
getBody() |
java.util.List<ExcludeRuleClass> |
getExcludeRules() |
protected java.util.List<FileRule> |
getExcludeRules(Filter<FileRule> filter) |
IncludeRuleClass |
getIncludeRuleFor(java.lang.String path) |
IncludeRuleClass |
getIncludeRuleMerged()
Return a common include rule for this CheckoutRules.
|
java.util.List<IncludeRuleClass> |
getIncludeRules() |
protected java.util.List<IncludeRuleClass> |
getIncludeRules(Filter<FileRule> filter) |
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isIgnoreCase() |
static boolean |
isSubDir(java.lang.String child,
java.lang.String parent) |
boolean |
isUnder(java.lang.String parentPath) |
protected void |
postProcessCreatedRules(java.util.List<IncludeRuleClass> includeRules,
java.util.List<ExcludeRuleClass> excludeRules) |
java.lang.String |
preparePath(java.lang.String path) |
void |
setIgnoreCase(boolean ignoreCase) |
boolean |
shouldInclude(java.lang.String path) |
protected boolean |
shouldInclude(java.lang.String path,
Filter<FileRule> includeExcludeRulesFilter) |
boolean |
shouldInclude(java.lang.String path,
IncludeRule rule) |
protected boolean |
shouldInclude(java.lang.String path,
java.util.List<IncludeRuleClass> includeRules,
java.util.List<FileRule> excludeRules) |
boolean |
shouldInclude(java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> props) |
protected static void |
sortByFrom(java.util.List<? extends FileRule> rules,
boolean reverse) |
public static final java.lang.String INCLUDE_PREFIX
public static final java.lang.String EXCLUDE_PREFIX
public static final java.lang.String IGNORE_CASE_MARK
public FileRuleSet(@NotNull java.util.List<java.lang.String> lines)
public FileRuleSet(@NotNull java.lang.String body)
public FileRuleSet(@NotNull java.util.List<IncludeRuleClass> includeRules, @NotNull java.util.List<ExcludeRuleClass> excludeRules)
@NotNull public static java.util.List<java.lang.String> convertToLines(@NotNull java.lang.String body)
FileRuleSet(List)
constructorbody
- text to split by lines@NotNull public java.lang.String preparePath(@Nullable java.lang.String path)
protected void postProcessCreatedRules(java.util.List<IncludeRuleClass> includeRules, java.util.List<ExcludeRuleClass> excludeRules)
protected abstract void doPostInitProcess(@NotNull java.util.List<IncludeRuleClass> includeRules, @NotNull java.util.List<ExcludeRuleClass> excludeRules)
protected abstract IncludeRuleClass createNewIncludeRule(java.lang.String rule)
protected abstract ExcludeRuleClass createNewExcludeRule(java.lang.String line)
protected static void sortByFrom(@NotNull java.util.List<? extends FileRule> rules, boolean reverse)
@NotNull public java.util.List<IncludeRuleClass> getIncludeRules()
@NotNull public java.util.List<ExcludeRuleClass> getExcludeRules()
@NotNull public java.util.List<java.lang.String> getBody()
protected abstract IncludeRuleClass createNewIncludeRule(@NotNull IncludeRuleClass includeRule)
protected abstract ExcludeRuleClass createNewExcludeRule(@NotNull ExcludeRuleClass includeRule)
public boolean shouldInclude(java.lang.String path, java.util.Map<java.lang.String,java.lang.String> props)
protected boolean shouldInclude(java.lang.String path, @NotNull Filter<FileRule> includeExcludeRulesFilter)
protected boolean shouldInclude(java.lang.String path, @NotNull java.util.List<IncludeRuleClass> includeRules, @NotNull java.util.List<FileRule> excludeRules)
@NotNull protected java.util.List<FileRule> getExcludeRules(Filter<FileRule> filter)
@NotNull protected java.util.List<IncludeRuleClass> getIncludeRules(Filter<FileRule> filter)
@NotNull protected Filter<FileRule> createPropertiesFilter(java.util.Map<java.lang.String,java.lang.String> props)
public boolean shouldInclude(java.lang.String path)
public boolean shouldInclude(@Nullable java.lang.String path, @NotNull IncludeRule rule)
@Nullable public IncludeRuleClass getIncludeRuleFor(java.lang.String path)
public boolean isUnder(java.lang.String parentPath)
parentPath
- path which is a candidate for a parent of all include rulespublic static boolean isSubDir(java.lang.String child, java.lang.String parent)
@Nullable public IncludeRuleClass getIncludeRuleMerged()
+:a/b +:a/c result = +:a +:a +:b result = +:. +:a/b => foo +:a => bar result = +:a => .
@Nullable protected static <T extends FileRule> T findMostSpecific(java.lang.String path, java.util.List<T> rules)
public boolean isIgnoreCase()
public void setIgnoreCase(boolean ignoreCase)
public boolean isEmpty()
@NotNull public java.lang.String describe(boolean verbose)
describe
in interface jetbrains.buildServer.log.Loggable
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object