Class AbstractRequireFiles
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
org.apache.maven.enforcer.rules.files.AbstractRequireFiles
- All Implemented Interfaces:
EnforcerRuleBase
- Direct Known Subclasses:
RequireFilesDontExist, RequireFilesExist, RequireFilesSize
Contains the common code to compare an array of files against a requirement.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanif null file handles should be allowed.List of files to check.private booleanAllow that a single one of the files can make the rule to pass. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract booleanCheck one file.voidexecute()This is the interface into the rule.private voidIf the rule is to be cached during session scope, whole executing of Maven build, this id is used as part of the key.(package private) abstract StringGets the error msg.getFiles()(package private) voidsetAllowNulls(boolean allowNulls) (package private) voidsetFilesList(List<File> files) (package private) voidsetSatisfyAny(boolean satisfyAny) toString()Methods inherited from class AbstractStandardEnforcerRule
formatLocation, getMessage, setMessageMethods inherited from class AbstractEnforcerRule
getLevel, getRuleNameMethods inherited from class AbstractEnforcerRuleBase
getLog, setLog
-
Field Details
-
files
-
allowNulls
private boolean allowNullsif null file handles should be allowed. If they are allowed, it means treat it as a success. -
satisfyAny
private boolean satisfyAnyAllow that a single one of the files can make the rule to pass.
-
-
Constructor Details
-
AbstractRequireFiles
AbstractRequireFiles()
-
-
Method Details
-
checkFile
Check one file.- Parameters:
file- the file- Returns:
trueif successful
-
getErrorMsg
-
execute
Description copied from class:AbstractEnforcerRuleThis is the interface into the rule. This method should throw an exception containing a reason message if the rule fails the check. The plugin will then decide based on the fail flag and rule level if it should stop or just log the message as a warning.- Specified by:
executein classAbstractEnforcerRule- Throws:
EnforcerRuleException- the enforcer rule exception
-
fail
- Throws:
EnforcerRuleException
-
getCacheId
Description copied from class:AbstractEnforcerRuleIf the rule is to be cached during session scope, whole executing of Maven build, this id is used as part of the key.Rule of the same class and the same cache id will be executed once.
- Overrides:
getCacheIdin classAbstractEnforcerRule- Returns:
- id to be used by the Enforcer to determine uniqueness of cache results.
Return
nulldisable cache of rule executing.
-
setFilesList
-
getFiles
-
setAllowNulls
void setAllowNulls(boolean allowNulls) -
setSatisfyAny
void setSatisfyAny(boolean satisfyAny) -
toString
-