Class RequireTextFileChecksum
- 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.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.- See Also:
RequireFileChecksum
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.charset.Charset
encoding
private NormalizeLineSeparatorReader.LineSeparator
normalizeLineSeparatorTo
private org.apache.maven.project.MavenProject
project
-
Constructor Summary
Constructors Constructor Description RequireTextFileChecksum(org.apache.maven.project.MavenProject project)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
calculateChecksum()
void
execute()
This is the interface into the rule.java.nio.charset.Charset
getEncoding()
void
setEncoding(java.lang.String encoding)
void
setNormalizeLineSeparatorTo(NormalizeLineSeparatorReader.LineSeparator normalizeLineSeparatorTo)
java.lang.String
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, getRuleName
-
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
getLog, setLog
-
-
-
-
Field Detail
-
normalizeLineSeparatorTo
private NormalizeLineSeparatorReader.LineSeparator normalizeLineSeparatorTo
-
encoding
private java.nio.charset.Charset encoding
-
project
private final org.apache.maven.project.MavenProject project
-
-
Method Detail
-
setNormalizeLineSeparatorTo
public void setNormalizeLineSeparatorTo(NormalizeLineSeparatorReader.LineSeparator normalizeLineSeparatorTo)
-
setEncoding
public void setEncoding(java.lang.String encoding)
-
getEncoding
public java.nio.charset.Charset getEncoding()
-
execute
public void execute() throws EnforcerRuleException
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 exceptionEnforcerRuleError
- in order to brake a build immediately
-
calculateChecksum
protected java.lang.String calculateChecksum() throws EnforcerRuleException
- Overrides:
calculateChecksum
in classRequireFileChecksum
- Throws:
EnforcerRuleException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classRequireFileChecksum
-
-