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 RequireFileChecksumRule 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.Charsetencodingprivate NormalizeLineSeparatorReader.LineSeparatornormalizeLineSeparatorToprivate org.apache.maven.project.MavenProjectproject
-
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.StringcalculateChecksum()voidexecute()This is the interface into the rule.java.nio.charset.CharsetgetEncoding()voidsetEncoding(java.lang.String encoding)voidsetNormalizeLineSeparatorTo(NormalizeLineSeparatorReader.LineSeparator normalizeLineSeparatorTo)java.lang.StringtoString()-
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 EnforcerRuleExceptionDescription 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 exceptionEnforcerRuleError- in order to brake a build immediately
-
calculateChecksum
protected java.lang.String calculateChecksum() throws EnforcerRuleException- Overrides:
calculateChecksumin classRequireFileChecksum- Throws:
EnforcerRuleException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classRequireFileChecksum
-
-