jetbrains.buildServer.vcs
Class FileRuleSet<IncludeRuleClass extends FileRule,ExcludeRuleClass extends FileRule>

java.lang.Object
  extended by jetbrains.buildServer.vcs.FileRuleSet<IncludeRuleClass,ExcludeRuleClass>
Direct Known Subclasses:
CheckoutRules

public abstract class FileRuleSet<IncludeRuleClass extends FileRule,ExcludeRuleClass extends FileRule>
extends java.lang.Object


Constructor Summary
FileRuleSet(java.util.List<IncludeRuleClass> includeRules, java.util.List<ExcludeRuleClass> excludeRules)
           
FileRuleSet(java.util.List<java.lang.String> body)
           
FileRuleSet(java.lang.String body)
           
 
Method Summary
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)
           
protected abstract  void doPostInitProcess(java.util.List<IncludeRuleClass> includeRules, java.util.List<ExcludeRuleClass> excludeRules)
           
protected static
<T extends FileRule>
T
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<FileRule> getIncludeRules(Filter<FileRule> filter)
           
static boolean isSubDir(java.lang.String child, java.lang.String parent)
           
protected  void postProcessCreatedRules(java.util.List<IncludeRuleClass> includeRules, java.util.List<ExcludeRuleClass> excludeRules)
           
protected static java.lang.String preparePath(java.lang.String path)
           
 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 static boolean shouldInclude(java.lang.String path, java.util.List<FileRule> 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileRuleSet

public FileRuleSet(@NotNull
                   java.util.List<java.lang.String> body)

FileRuleSet

public FileRuleSet(@NotNull
                   java.lang.String body)

FileRuleSet

public FileRuleSet(java.util.List<IncludeRuleClass> includeRules,
                   java.util.List<ExcludeRuleClass> excludeRules)
Method Detail

preparePath

@NotNull
protected static java.lang.String preparePath(@Nullable
                                                      java.lang.String path)

postProcessCreatedRules

protected void postProcessCreatedRules(java.util.List<IncludeRuleClass> includeRules,
                                       java.util.List<ExcludeRuleClass> excludeRules)

doPostInitProcess

protected abstract void doPostInitProcess(java.util.List<IncludeRuleClass> includeRules,
                                          java.util.List<ExcludeRuleClass> excludeRules)

createNewIncludeRule

protected abstract IncludeRuleClass createNewIncludeRule(java.lang.String rule)

createNewExcludeRule

protected abstract ExcludeRuleClass createNewExcludeRule(java.lang.String line)

sortByFrom

protected static void sortByFrom(java.util.List<? extends FileRule> rules,
                                 boolean reverse)

getIncludeRules

public java.util.List<IncludeRuleClass> getIncludeRules()

getExcludeRules

public java.util.List<ExcludeRuleClass> getExcludeRules()

getBody

public java.util.List<java.lang.String> getBody()

createNewIncludeRule

protected abstract IncludeRuleClass createNewIncludeRule(IncludeRuleClass includeRule)

createNewExcludeRule

protected abstract ExcludeRuleClass createNewExcludeRule(ExcludeRuleClass includeRule)

shouldInclude

public boolean shouldInclude(java.lang.String path,
                             java.util.Map<java.lang.String,java.lang.String> props)

shouldInclude

protected boolean shouldInclude(java.lang.String path,
                                @NotNull
                                Filter<FileRule> includeExcludeRulesFilter)

shouldInclude

protected static boolean shouldInclude(java.lang.String path,
                                       @NotNull
                                       java.util.List<FileRule> includeRules,
                                       @NotNull
                                       java.util.List<FileRule> excludeRules)

getExcludeRules

@NotNull
protected java.util.List<FileRule> getExcludeRules(Filter<FileRule> filter)

getIncludeRules

@NotNull
protected java.util.List<FileRule> getIncludeRules(Filter<FileRule> filter)

createPropertiesFilter

@NotNull
protected Filter<FileRule> createPropertiesFilter(java.util.Map<java.lang.String,java.lang.String> props)

shouldInclude

public boolean shouldInclude(java.lang.String path)

shouldInclude

public boolean shouldInclude(java.lang.String path,
                             IncludeRule rule)

getIncludeRuleFor

@Nullable
public IncludeRuleClass getIncludeRuleFor(java.lang.String path)

isSubDir

public static boolean isSubDir(java.lang.String child,
                               java.lang.String parent)

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(java.lang.String path,
                                                                  java.util.List<T> rules)