@Plugin(name="IfLastModified", category="Core", printObject=true) public final class IfLastModified extends java.lang.Object implements PathCondition
| Modifier and Type | Field and Description |
|---|---|
private Duration |
age |
private static Clock |
CLOCK |
private static Logger |
LOGGER |
private PathCondition[] |
nestedConditions |
| Modifier | Constructor and Description |
|---|---|
private |
IfLastModified(Duration age,
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 IfLastModified |
createAgeCondition(Duration age,
PathCondition... nestedConditions)
Create an IfLastModified condition.
|
Duration |
getAge() |
java.util.List<PathCondition> |
getNestedConditions() |
java.lang.String |
toString() |
private static final Logger LOGGER
private static final Clock CLOCK
private final Duration age
private final PathCondition[] nestedConditions
private IfLastModified(Duration age, PathCondition[] nestedConditions)
public Duration getAge()
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 IfLastModified createAgeCondition(@PluginAttribute(value="age") Duration age, @PluginElement(value="PathConditions") PathCondition... nestedConditions)
age - The path age that is accepted by this condition. Must be a valid Duration.nestedConditions - nested conditions to evaluate if this condition accepts a pathpublic java.lang.String toString()
toString in class java.lang.Object