Interface PathCondition
-
- All Known Implementing Classes:
IfAccumulatedFileCount,IfAccumulatedFileSize,IfAll,IfAny,IfFileName,IfLastModified,IfNot
public interface PathConditionFilter that accepts or rejects a candidatePathfor deletion.
-
-
Field Summary
Fields Modifier and Type Field Description static PathCondition[]EMPTY_ARRAYThe empty array.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaccept(java.nio.file.Path baseDir, java.nio.file.Path relativePath, java.nio.file.attribute.BasicFileAttributes attrs)Returnstrueif the specified candidate path should be deleted,falseotherwise.voidbeforeFileTreeWalk()Invoked before a new file tree walk is started.static PathCondition[]copy(PathCondition... source)Copies the given input.
-
-
-
Field Detail
-
EMPTY_ARRAY
static final PathCondition[] EMPTY_ARRAY
The empty array.
-
-
Method Detail
-
copy
static PathCondition[] copy(PathCondition... source)
Copies the given input.- Parameters:
source- What to copy- Returns:
- a copy, never null.
-
beforeFileTreeWalk
void beforeFileTreeWalk()
Invoked before a new file tree walk is started. Stateful PathConditions can reset their state when this method is called.
-
accept
boolean accept(java.nio.file.Path baseDir, java.nio.file.Path relativePath, java.nio.file.attribute.BasicFileAttributes attrs)Returnstrueif the specified candidate path should be deleted,falseotherwise.- Parameters:
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 path- Returns:
- whether the candidate path should be deleted
-
-