Class RequireTextFileChecksum
java.lang.Object
org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule
org.apache.maven.plugins.enforcer.AbstractNonCacheableEnforcerRule
org.apache.maven.plugins.enforcer.RequireFileChecksum
org.apache.maven.plugins.enforcer.RequireTextFileChecksum
- All Implemented Interfaces:
EnforcerRule
,EnforcerRule2
Rule to validate a text file to match the specified checksum.
- See Also:
-
Field Summary
FieldsFields inherited from class org.apache.maven.plugins.enforcer.RequireFileChecksum
file
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
void
execute
(EnforcerRuleHelper helper) This is the interface into the rule.void
setEncoding
(String encoding) void
setNormalizeLineSeparatorTo
(NormalizeLineSeparatorReader.LineSeparator normalizeLineSeparatorTo) Methods inherited from class org.apache.maven.plugins.enforcer.RequireFileChecksum
calculateChecksum, setChecksum, setFile, setNonexistentFileMessage, setType
Methods inherited from class org.apache.maven.plugins.enforcer.AbstractNonCacheableEnforcerRule
getCacheId, isCacheable, isResultValid
Methods inherited from class org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule
getLevel, getMessage, setLevel, setMessage
-
Field Details
-
normalizeLineSeparatorTo
-
encoding
Charset encoding
-
-
Constructor Details
-
RequireTextFileChecksum
public RequireTextFileChecksum()
-
-
Method Details
-
setNormalizeLineSeparatorTo
public void setNormalizeLineSeparatorTo(NormalizeLineSeparatorReader.LineSeparator normalizeLineSeparatorTo) -
setEncoding
-
execute
Description copied from interface:EnforcerRule
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 if it should stop or just log the message as a warning.- Specified by:
execute
in interfaceEnforcerRule
- Overrides:
execute
in classRequireFileChecksum
- Parameters:
helper
- The helper provides access to the log, MavenSession and has helpers to get common components. It is also able to lookup components by class name.- Throws:
EnforcerRuleException
- the enforcer rule exception
-
calculateChecksum
- Overrides:
calculateChecksum
in classRequireFileChecksum
- Throws:
EnforcerRuleException
-