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
public class RequireTextFileChecksum extends RequireFileChecksum
Rule to validate a text file to match the specified checksum.- See Also:
RequireFileChecksum
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.nio.charset.Charset
encoding
private NormalizeLineSeparatorReader.LineSeparator
normalizeLineSeparatorTo
-
Fields inherited from class org.apache.maven.plugins.enforcer.RequireFileChecksum
file
-
-
Constructor Summary
Constructors Constructor Description RequireTextFileChecksum()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
calculateChecksum()
void
execute(EnforcerRuleHelper helper)
This is the interface into the rule.void
setEncoding(java.lang.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 Detail
-
normalizeLineSeparatorTo
private NormalizeLineSeparatorReader.LineSeparator normalizeLineSeparatorTo
-
encoding
java.nio.charset.Charset encoding
-
-
Method Detail
-
setNormalizeLineSeparatorTo
public void setNormalizeLineSeparatorTo(NormalizeLineSeparatorReader.LineSeparator normalizeLineSeparatorTo)
-
setEncoding
public void setEncoding(java.lang.String encoding)
-
execute
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException
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
protected java.lang.String calculateChecksum() throws EnforcerRuleException
- Overrides:
calculateChecksum
in classRequireFileChecksum
- Throws:
EnforcerRuleException
-
-