jetbrains.buildServer.vcs
Class FileRule<ParentRules extends FileRuleSet>

java.lang.Object
  extended by jetbrains.buildServer.vcs.FileRule<ParentRules>
Direct Known Subclasses:
IncludeRule

public class FileRule<ParentRules extends FileRuleSet>
extends java.lang.Object


Field Summary
protected  java.lang.String myFromFull
           
protected  java.lang.String myFromPath
           
protected  java.util.regex.Pattern myPattern
           
 
Constructor Summary
FileRule(java.lang.String from, ParentRules parentRules, boolean isInclude)
           
FileRule(java.lang.String from, ParentRules parentRules, boolean isInclude, boolean usePattern)
           
FileRule(java.lang.String fromPath, java.lang.String additionalProperties, ParentRules parentRules, boolean isInclude)
           
 
Method Summary
protected  java.lang.String createPatternString(java.lang.String from)
           
 java.util.Map<java.lang.String,java.lang.String> getAdditionalProperties()
           
 java.lang.String getFrom()
           
 java.lang.String getMatchedHead(java.lang.String path)
          returns matched head path without trailing wildcards if matched with path, null otherwise
 ParentRules getParentRules()
           
 java.lang.String getProperty(java.lang.String propName)
           
 boolean isAbsolutePath()
           
 boolean isIsInclude()
           
 boolean isRoot()
           
protected static java.lang.String prepareRulePath(java.lang.String path)
           
 boolean propertiesMatch(java.util.Map<java.lang.String,java.lang.String> props)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myFromPath

protected final java.lang.String myFromPath

myFromFull

protected final java.lang.String myFromFull

myPattern

protected final java.util.regex.Pattern myPattern
Constructor Detail

FileRule

public FileRule(java.lang.String from,
                ParentRules parentRules,
                boolean isInclude)

FileRule

public FileRule(java.lang.String from,
                ParentRules parentRules,
                boolean isInclude,
                boolean usePattern)
Parameters:
from - from part of the rule
parentRules - parent rules
isInclude - true if it is an include rule
usePattern - true if regexp pattern should be used to match paths (can be slow and require more memory), false if pattern shouldn't be created and ancestor of this class does all the matching in the overridden getMatchedHead(java.lang.String) method

FileRule

public FileRule(@NotNull
                java.lang.String fromPath,
                @Nullable
                java.lang.String additionalProperties,
                @NotNull
                ParentRules parentRules,
                boolean isInclude)
Method Detail

prepareRulePath

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

createPatternString

@NotNull
protected java.lang.String createPatternString(@NotNull
                                                       java.lang.String from)

getFrom

public java.lang.String getFrom()

getParentRules

public ParentRules getParentRules()

isIsInclude

public boolean isIsInclude()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getMatchedHead

@Nullable
public java.lang.String getMatchedHead(java.lang.String path)
returns matched head path without trailing wildcards if matched with path, null otherwise

Parameters:
path - file path to match with
Returns:
matched head path without trailing wildcards

getProperty

@Nullable
public java.lang.String getProperty(java.lang.String propName)

propertiesMatch

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

getAdditionalProperties

@Nullable
public java.util.Map<java.lang.String,java.lang.String> getAdditionalProperties()

isAbsolutePath

public boolean isAbsolutePath()

isRoot

public boolean isRoot()
Returns:
true if from part represents root directory (from = ".")