Class RequireTextFileChecksum
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
org.apache.maven.enforcer.rules.checksum.RequireFileChecksum
org.apache.maven.enforcer.rules.checksum.RequireTextFileChecksum
- All Implemented Interfaces:
EnforcerRuleBase
@Named("requireTextFileChecksum")
public final class RequireTextFileChecksum
extends RequireFileChecksum
Rule to validate a text file to match the specified checksum.
- Author:
- Konrad Windszus
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
void
execute()
This is the interface into the rule.getLog()
Provide anEnforcerLogger
instance for Rulevoid
setEncoding
(String encoding) void
setLog
(EnforcerLogger log) Used byEnforcerMojo
to inject logger instancevoid
setNormalizeLineSeparatorTo
(org.apache.maven.enforcer.rules.checksum.NormalizeLineSeparatorReader.LineSeparator normalizeLineSeparatorTo) toString()
Methods inherited from class org.apache.maven.enforcer.rules.checksum.RequireFileChecksum
calculateChecksum, getChecksum, getFile, getNonexistentFileMessage, getType, setChecksum, setFile, setNonexistentFileMessage, setType
Methods inherited from class org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
formatLocation, getMessage, setMessage
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
getCacheId, getLevel
-
Constructor Details
-
RequireTextFileChecksum
-
-
Method Details
-
setNormalizeLineSeparatorTo
public void setNormalizeLineSeparatorTo(org.apache.maven.enforcer.rules.checksum.NormalizeLineSeparatorReader.LineSeparator normalizeLineSeparatorTo) -
setEncoding
-
getEncoding
-
execute
Description copied from class:AbstractEnforcerRule
This 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.- Overrides:
execute
in classRequireFileChecksum
- Throws:
EnforcerRuleException
- the enforcer rule exception
-
calculateChecksum
- Overrides:
calculateChecksum
in classRequireFileChecksum
- Throws:
EnforcerRuleException
-
toString
- Overrides:
toString
in classRequireFileChecksum
-
setLog
Used byEnforcerMojo
to inject logger instance- Specified by:
setLog
in interfaceEnforcerRuleBase
- Parameters:
log
- anEnforcerLogger
instance
-
getLog
Provide anEnforcerLogger
instance for RuleNOTICE A logger is not available in constructors.
- Returns:
- an
EnforcerLogger
instance
-