public class RequireFilesSize extends AbstractRequireFiles
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
errorMsg
The error msg.
|
private org.apache.maven.plugin.logging.Log |
log
The log.
|
private long |
maxsize
the max size allowed.
|
private static long |
MAXSIZE |
private long |
minsize
the min size allowed.
|
Constructor and Description |
---|
RequireFilesSize() |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
checkFile(java.io.File file)
Check one file.
|
void |
execute(EnforcerRuleHelper helper)
This is the interface into the rule.
|
(package private) java.lang.String |
getErrorMsg()
Gets the error msg.
|
long |
getMaxsize() |
long |
getMinsize() |
boolean |
isCacheable()
This tells the system if the results are cacheable at all.
|
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
private static final long MAXSIZE
private long maxsize
private long minsize
private java.lang.String errorMsg
private org.apache.maven.plugin.logging.Log log
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException
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()
isCacheable
in interface EnforcerRule
isCacheable
in class AbstractRequireFiles
true
if rule is cacheablepublic boolean isResultValid(EnforcerRule cachedRule)
isResultValid
in interface EnforcerRule
isResultValid
in class AbstractRequireFiles
cachedRule
- the cached ruletrue
if the stored results are valid for the same id.boolean checkFile(java.io.File file)
checkFile
in class AbstractRequireFiles
file
- the filetrue
if successfuljava.lang.String getErrorMsg()
getErrorMsg
in class AbstractRequireFiles
public long getMaxsize()
public void setMaxsize(long maxsize)
public long getMinsize()
public void setMinsize(long minsize)