public class CheckoutRules extends FileRuleSet<IncludeRule,FileRule>
Modifier and Type | Field and Description |
---|---|
static CheckoutRules |
DEFAULT |
static java.lang.String |
INCLUDE_SEP |
EXCLUDE_PREFIX, IGNORE_CASE_MARK, INCLUDE_PREFIX
Constructor and Description |
---|
CheckoutRules(java.util.List<IncludeRule> includeRules,
java.util.List<FileRule> excludeRules)
Creates rules object on include and exclude rules lists.
|
CheckoutRules(java.util.List<java.lang.String> lines)
Creates new checkout rules instance on a list of string rules.
|
CheckoutRules(java.lang.String body)
Creates new checkout rules instance on string rules presentation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsWildcards()
Checks if some rule from the set contains wildcards.
|
static CheckoutRules |
createCommonRule(java.util.List<CheckoutRules> ruleses)
Creates 'union' rule
|
protected FileRule |
createNewExcludeRule(FileRule rule) |
protected FileRule |
createNewExcludeRule(java.lang.String line) |
protected IncludeRule |
createNewIncludeRule(IncludeRule includeRule) |
protected IncludeRule |
createNewIncludeRule(java.lang.String rule) |
CheckoutRules |
createNewRulesForPrefix(java.lang.String prefixPath)
Creates new checkout rule set with prefix appended to every rule right part.
|
static CheckoutRules |
createOn(java.lang.String ruleStr)
Creates new rule set on the specified rules string presentation.
|
protected void |
doPostInitProcess(java.util.List<IncludeRule> includeRules,
java.util.List<FileRule> excludeRules) |
java.lang.String |
getAsString() |
java.util.List<IncludeRule> |
getRootIncludeRules()
Returns include rules sorted by from part.
|
boolean |
includesAny(java.util.Collection<java.lang.String> paths)
Returns true if these checkout rules include at least one of the specified paths.
|
static boolean |
isCorrect(java.lang.String line)
Returns true if line represents syntactically correct include or exclude rule.
|
boolean |
isIncludeAll() |
java.util.Collection<java.lang.String> |
map(java.util.Collection<java.lang.String> paths)
Maps a collection of vcs relative file path to path described by checkout rules, non-matched paths from the collection is skipped
|
java.lang.String |
map(java.lang.String path)
Maps vcs relative file path to path described by checkout rules.
|
protected void |
postProcessCreatedRules(java.util.List<IncludeRule> includeRules,
java.util.List<FileRule> excludeRules) |
boolean |
shouldInclude(java.lang.String path) |
protected boolean |
shouldInclude(java.lang.String path,
Filter<FileRule> includeExcludeRulesFilter) |
boolean |
shouldInclude(java.lang.String path,
IncludeRule rule) |
boolean |
shouldInclude(java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> props) |
java.lang.String |
toString() |
convertToLines, createPropertiesFilter, describe, equals, findMostSpecific, getBody, getExcludeRules, getExcludeRules, getIncludeRuleFor, getIncludeRuleMerged, getIncludeRules, getIncludeRules, hashCode, isEmpty, isIgnoreCase, isSubDir, isUnder, preparePath, setIgnoreCase, shouldInclude, sortByFrom
public static final CheckoutRules DEFAULT
public static final java.lang.String INCLUDE_SEP
public CheckoutRules(@NotNull java.util.List<java.lang.String> lines)
lines
- list of string rules, lines should not contain newline characterspublic CheckoutRules(@NotNull java.lang.String body)
body
- string rule presentation.public CheckoutRules(@NotNull java.util.List<IncludeRule> includeRules, @NotNull java.util.List<FileRule> excludeRules)
includeRules
- include rules list.excludeRules
- exclude rules list.@NotNull public java.util.Collection<java.lang.String> map(@NotNull java.util.Collection<java.lang.String> paths)
paths
- to mapmap(String)
@Nullable public java.lang.String map(java.lang.String path)
path
- to mappublic boolean isIncludeAll()
public boolean includesAny(@NotNull java.util.Collection<java.lang.String> paths)
paths
- paths to checkpublic boolean shouldInclude(java.lang.String path)
shouldInclude
in class FileRuleSet<IncludeRule,FileRule>
public boolean shouldInclude(java.lang.String path, java.util.Map<java.lang.String,java.lang.String> props)
shouldInclude
in class FileRuleSet<IncludeRule,FileRule>
protected boolean shouldInclude(java.lang.String path, @NotNull Filter<FileRule> includeExcludeRulesFilter)
shouldInclude
in class FileRuleSet<IncludeRule,FileRule>
public boolean shouldInclude(java.lang.String path, @NotNull IncludeRule rule)
shouldInclude
in class FileRuleSet<IncludeRule,FileRule>
@NotNull public static CheckoutRules createCommonRule(@NotNull java.util.List<CheckoutRules> ruleses)
ruleses
- given rule set.@NotNull public java.lang.String toString()
toString
in class java.lang.Object
@NotNull public java.lang.String getAsString()
public static boolean isCorrect(@NotNull java.lang.String line)
line
- include or exclude rulepublic java.util.List<IncludeRule> getRootIncludeRules()
@NotNull public CheckoutRules createNewRulesForPrefix(@NotNull java.lang.String prefixPath)
prefixPath
- specified prefix.protected void postProcessCreatedRules(java.util.List<IncludeRule> includeRules, java.util.List<FileRule> excludeRules)
postProcessCreatedRules
in class FileRuleSet<IncludeRule,FileRule>
protected void doPostInitProcess(@NotNull java.util.List<IncludeRule> includeRules, @NotNull java.util.List<FileRule> excludeRules)
doPostInitProcess
in class FileRuleSet<IncludeRule,FileRule>
protected IncludeRule createNewIncludeRule(java.lang.String rule)
createNewIncludeRule
in class FileRuleSet<IncludeRule,FileRule>
protected FileRule createNewExcludeRule(java.lang.String line)
createNewExcludeRule
in class FileRuleSet<IncludeRule,FileRule>
protected IncludeRule createNewIncludeRule(IncludeRule includeRule)
createNewIncludeRule
in class FileRuleSet<IncludeRule,FileRule>
protected FileRule createNewExcludeRule(FileRule rule)
createNewExcludeRule
in class FileRuleSet<IncludeRule,FileRule>
public static CheckoutRules createOn(java.lang.String ruleStr)
ruleStr
- specified rule set string presentation.public boolean containsWildcards()
true
if some rule from the set contains wildcard, false
otherwise.