public class RequireFileChecksum extends AbstractNonCacheableEnforcerRule
RequireTextFileChecksum
Constructor and Description |
---|
RequireFileChecksum() |
Modifier and Type | Method and Description |
---|---|
protected String |
calculateChecksum() |
protected String |
calculateChecksum(InputStream inputStream) |
void |
execute(EnforcerRuleHelper helper)
This is the interface into the rule.
|
void |
setChecksum(String checksum)
The expected checksum value.
|
void |
setFile(File file)
The file to check.
|
void |
setNonexistentFileMessage(String nonexistentFileMessage)
The friendly message to use when the file does not exist.
|
void |
setType(String type)
The checksum algorithm to use.
|
getCacheId, isCacheable, isResultValid
getLevel, getMessage, setLevel, setMessage
public RequireFileChecksum()
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException
EnforcerRule
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.EnforcerRuleException
- the enforcer rule exceptionpublic void setChecksum(String checksum)
checksum
- checksumpublic void setType(String type)
type
- algorithmpublic void setNonexistentFileMessage(String nonexistentFileMessage)
nonexistentFileMessage
- messageprotected String calculateChecksum() throws EnforcerRuleException
EnforcerRuleException
protected String calculateChecksum(InputStream inputStream) throws IOException, EnforcerRuleException
IOException
EnforcerRuleException
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.