Package jetbrains.buildServer.vcs
Class FileRuleSet<IncludeRuleClass extends FileRule,ExcludeRuleClass extends FileRule>
- java.lang.Object
-
- jetbrains.buildServer.vcs.FileRuleSet<IncludeRuleClass,ExcludeRuleClass>
-
- All Implemented Interfaces:
Loggable
- Direct Known Subclasses:
ArtifactDepRuleSet
,CheckoutRules
,TriggerRulesImpl
public abstract class FileRuleSet<IncludeRuleClass extends FileRule,ExcludeRuleClass extends FileRule> extends Object implements Loggable
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCLUDE_PREFIX
static String
IGNORE_CASE_MARK
static String
INCLUDE_PREFIX
-
Constructor Summary
Constructors Constructor Description FileRuleSet(String body)
FileRuleSet(List<IncludeRuleClass> includeRules, List<ExcludeRuleClass> excludeRules)
FileRuleSet(List<String> lines)
-
Method Summary
-
-
-
Field Detail
-
INCLUDE_PREFIX
public static final String INCLUDE_PREFIX
- Since:
- 9.0
- See Also:
- Constant Field Values
-
EXCLUDE_PREFIX
public static final String EXCLUDE_PREFIX
- Since:
- 9.0
- See Also:
- Constant Field Values
-
IGNORE_CASE_MARK
public static final String IGNORE_CASE_MARK
- Since:
- 2017.1, see https://youtrack.jetbrains.com/issue/TW-27485
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FileRuleSet
public FileRuleSet(@NotNull String body)
-
FileRuleSet
public FileRuleSet(@NotNull List<IncludeRuleClass> includeRules, @NotNull List<ExcludeRuleClass> excludeRules)
-
-
Method Detail
-
convertToLines
@NotNull public static List<String> convertToLines(@NotNull String body)
Accepts string and transforms it to the list of lines which can be passed to theFileRuleSet(List)
constructor- Parameters:
body
- text to split by lines- Returns:
- list of lines
- Since:
- 2019.1
-
postProcessCreatedRules
protected void postProcessCreatedRules(List<IncludeRuleClass> includeRules, List<ExcludeRuleClass> excludeRules)
-
doPostInitProcess
protected abstract void doPostInitProcess(@NotNull List<IncludeRuleClass> includeRules, @NotNull List<ExcludeRuleClass> excludeRules)
-
createNewIncludeRule
protected abstract IncludeRuleClass createNewIncludeRule(String rule)
-
createNewExcludeRule
protected abstract ExcludeRuleClass createNewExcludeRule(String line)
-
sortByFrom
protected static void sortByFrom(@NotNull List<? extends FileRule> rules, boolean reverse)
-
getIncludeRules
@NotNull public List<IncludeRuleClass> getIncludeRules()
-
getExcludeRules
@NotNull public List<ExcludeRuleClass> getExcludeRules()
-
createNewIncludeRule
protected abstract IncludeRuleClass createNewIncludeRule(@NotNull IncludeRuleClass includeRule)
-
createNewExcludeRule
protected abstract ExcludeRuleClass createNewExcludeRule(@NotNull ExcludeRuleClass includeRule)
-
shouldInclude
protected boolean shouldInclude(String path, @NotNull Filter<FileRule> includeExcludeRulesFilter)
-
shouldInclude
protected boolean shouldInclude(String path, @NotNull List<IncludeRuleClass> includeRules, @NotNull List<FileRule> excludeRules)
-
getIncludeRules
@NotNull protected List<IncludeRuleClass> getIncludeRules(Filter<FileRule> filter)
-
createPropertiesFilter
@NotNull protected Filter<FileRule> createPropertiesFilter(Map<String,String> props)
-
shouldInclude
public boolean shouldInclude(String path)
-
shouldInclude
public boolean shouldInclude(@Nullable String path, @NotNull IncludeRule rule)
-
getIncludeRuleFor
@Nullable public IncludeRuleClass getIncludeRuleFor(String path)
-
isUnder
public boolean isUnder(String parentPath)
- Parameters:
parentPath
- path which is a candidate for a parent of all include rules- Returns:
- true if all include paths of these Checkout rules are under given parent path
-
getIncludeRuleMerged
@Nullable public IncludeRuleClass getIncludeRuleMerged()
Return a common include rule for this CheckoutRules. Right part of the IncludeRule is not considered at all here.+:a/b +:a/c result = +:a +:a +:b result = +:. +:a/b => foo +:a => bar result = +:a => .
- Returns:
- see above
- Since:
- 7.0
-
findMostSpecific
@Nullable protected static <T extends FileRule> T findMostSpecific(String path, List<T> rules)
-
isIgnoreCase
public boolean isIgnoreCase()
-
setIgnoreCase
public void setIgnoreCase(boolean ignoreCase)
-
isEmpty
public boolean isEmpty()
-
describe
@NotNull public String describe(boolean verbose)
-
-