@Plugin(name="IfAll", category="Core", printObject=true) public final class IfAll extends Object implements PathCondition
PathCondition
that only accepts objects that are accepted by all component conditions.
Corresponds to logical "AND".Modifier and Type | Method and Description |
---|---|
static boolean |
accept(PathCondition[] list,
Path baseDir,
Path relativePath,
BasicFileAttributes attrs)
Returns
true if all the specified conditions accept the specified path, false otherwise. |
boolean |
accept(Path baseDir,
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 void |
beforeFileTreeWalk(PathCondition[] nestedConditions)
Calls
beforeFileTreeWalk() on all of the specified nested conditions. |
static IfAll |
createAndCondition(PathCondition... components)
Create a Composite PathCondition whose components all need to accept before this condition accepts.
|
PathCondition[] |
getDeleteFilters() |
String |
toString() |
public PathCondition[] getDeleteFilters()
public boolean accept(Path baseDir, Path relativePath, BasicFileAttributes attrs)
PathCondition
true
if the specified candidate path should be deleted, false
otherwise.accept
in interface PathCondition
baseDir
- 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 static boolean accept(PathCondition[] list, Path baseDir, Path relativePath, BasicFileAttributes attrs)
true
if all the specified conditions accept the specified path, false
otherwise.list
- the array of conditions to evaluatebaseDir
- 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 pathtrue
if all the specified conditions accept the specified path, false
otherwiseNullPointerException
- if any of the parameters is null
public void beforeFileTreeWalk()
PathCondition
beforeFileTreeWalk
in interface PathCondition
public static void beforeFileTreeWalk(PathCondition[] nestedConditions)
beforeFileTreeWalk()
on all of the specified nested conditions.nestedConditions
- the conditions to call beforeFileTreeWalk()
on@PluginFactory public static IfAll createAndCondition(@PluginElement(value="PathConditions") PathCondition... components)
components
- The component filters.Copyright © 1999-2017. 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.