FileVisitor<Path>public class DeletingVisitor extends SimpleFileVisitor<Path>
| Constructor | Description |
|---|---|
DeletingVisitor(Path basePath,
List<? extends PathCondition> pathConditions,
boolean testMode) |
Constructs a new DeletingVisitor.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
delete(Path file) |
Deletes the specified file.
|
boolean |
isTestMode() |
Returns
true if files are not deleted even when all conditions accept a path, false otherwise. |
FileVisitResult |
visitFile(Path file,
BasicFileAttributes attrs) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpostVisitDirectory, preVisitDirectory, visitFileFailedpublic DeletingVisitor(Path basePath, List<? extends PathCondition> pathConditions, boolean testMode)
basePath - used to relativize pathspathConditions - objects that need to confirm whether a file can be deletedtestMode - if true, files are not deleted but instead a message is printed to the status logger
at INFO level. Users can use this to do a dry run to test if their configuration works as expected.public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException
visitFile in interface FileVisitor<Path>visitFile in class SimpleFileVisitor<Path>IOExceptionprotected void delete(Path file) throws IOException
file - the file to deleteIOException - if a problem occurred deleting the filepublic boolean isTestMode()
true if files are not deleted even when all conditions accept a path, false otherwise.true if files are not deleted even when all conditions accept a path, false otherwiseCopyright © 1999-2018. 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.