@Plugin(name="IfLastModified", category="Core", printObject=true) public final class IfLastModified extends Object implements PathCondition
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Path basePath,
Path relativePath,
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() |
List<PathCondition> |
getNestedConditions() |
String |
toString() |
public List<PathCondition> getNestedConditions()
public boolean accept(Path basePath, Path relativePath, BasicFileAttributes attrs)
PathCondition
true
if the specified candidate path should be deleted, false
otherwise.accept
in interface PathCondition
basePath
- 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()
PathCondition
beforeFileTreeWalk
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 pathCopyright © 1999-2021 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.