public class RequireFilesSize extends AbstractRequireFiles
Constructor and Description |
---|
RequireFilesSize() |
Modifier and Type | Method and Description |
---|---|
void |
execute(EnforcerRuleHelper helper)
This is the interface into the rule.
|
long |
getMaxsize() |
long |
getMinsize() |
boolean |
isCacheable()
This method tells the enforcer if the rule results may be cached.
|
boolean |
isResultValid(EnforcerRule cachedRule)
If the rule is cacheable and the same id is found in the cache, the stored results are passed to this method to
allow double checking of the results.
|
void |
setMaxsize(long maxsize) |
void |
setMinsize(long minsize) |
getCacheId, getFiles, isAllowNulls, setAllowNulls, setFiles
getLevel, getMessage, setLevel, setMessage
public RequireFilesSize()
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException
EnforcerRule
execute
in interface EnforcerRule
execute
in class AbstractRequireFiles
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 boolean isCacheable()
EnforcerRule
isCacheable
in interface EnforcerRule
isCacheable
in class AbstractRequireFiles
true
if rule is cacheablepublic boolean isResultValid(EnforcerRule cachedRule)
EnforcerRule
isResultValid
in interface EnforcerRule
isResultValid
in class AbstractRequireFiles
cachedRule
- the last cached instance of the rule. This is to be used by the rule to
potentially determine if the results are still valid (ie if the configuration has been overridden)true
if the stored results are valid for the same id.public long getMaxsize()
public void setMaxsize(long maxsize)
public long getMinsize()
public void setMinsize(long minsize)
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.