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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringvoidexecute()This is the interface into the rule.getLog()Provide anEnforcerLoggerinstance for RulevoidsetEncoding(String encoding) voidsetLog(EnforcerLogger log) Used byEnforcerMojoto inject logger instancevoidsetNormalizeLineSeparatorTo(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, setTypeMethods inherited from class org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
formatLocation, getMessage, setMessageMethods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
getCacheId, getLevel, getRuleName
-
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: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.- Overrides:
executein classRequireFileChecksum- Throws:
EnforcerRuleException- the enforcer rule exception
-
calculateChecksum
- Overrides:
calculateChecksumin classRequireFileChecksum- Throws:
EnforcerRuleException
-
toString
- Overrides:
toStringin classRequireFileChecksum
-
setLog
Used byEnforcerMojoto inject logger instance- Specified by:
setLogin interfaceEnforcerRuleBase- Parameters:
log- anEnforcerLoggerinstance
-
getLog
Provide anEnforcerLoggerinstance for RuleNOTICE A logger is not available in constructors.
- Returns:
- an
EnforcerLoggerinstance
-