@Plugin(name="IfAccumulatedFileSize", category="Core", printObject=true) public final class IfAccumulatedFileSize extends java.lang.Object implements PathCondition
| Modifier and Type | Field and Description |
|---|---|
private long |
accumulatedSize |
private static Logger |
LOGGER |
private PathCondition[] |
nestedConditions |
private long |
thresholdBytes |
| Modifier | Constructor and Description |
|---|---|
private |
IfAccumulatedFileSize(long thresholdSize,
PathCondition[] nestedConditions) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(java.nio.file.Path basePath,
java.nio.file.Path relativePath,
java.nio.file.attribute.BasicFileAttributes attrs)
Returns
true if the specified candidate path should be deleted, false otherwise. |
void |
beforeFileTreeWalk()
Invoked before a new file
tree walk is started.
|
static IfAccumulatedFileSize |
createFileSizeCondition(java.lang.String size,
PathCondition... nestedConditions)
Create an IfAccumulatedFileSize condition.
|
java.util.List<PathCondition> |
getNestedConditions() |
long |
getThresholdBytes() |
java.lang.String |
toString() |
private static final Logger LOGGER
private final long thresholdBytes
private long accumulatedSize
private final PathCondition[] nestedConditions
private IfAccumulatedFileSize(long thresholdSize,
PathCondition[] nestedConditions)
public long getThresholdBytes()
public java.util.List<PathCondition> getNestedConditions()
public boolean accept(java.nio.file.Path basePath,
java.nio.file.Path relativePath,
java.nio.file.attribute.BasicFileAttributes attrs)
PathConditiontrue if the specified candidate path should be deleted, false otherwise.accept in interface PathConditionbasePath - the directory from where to start scanning for deletion candidate filesrelativePath - the candidate for deletion. This path is relative to the baseDir.attrs - attributes of the candidate pathpublic void beforeFileTreeWalk()
PathConditionbeforeFileTreeWalk in interface PathCondition@PluginFactory public static IfAccumulatedFileSize createFileSizeCondition(@PluginAttribute(value="exceeds") java.lang.String size, @PluginElement(value="PathConditions") PathCondition... nestedConditions)
threshold - The threshold accumulated file size from which files will be deleted.public java.lang.String toString()
toString in class java.lang.Object