java.lang.Object
java.nio.file.SimpleFileVisitor<Path>
org.apache.logging.log4j.core.appender.rolling.action.DeletingVisitor
All Implemented Interfaces:
FileVisitor<Path>

public class DeletingVisitor extends SimpleFileVisitor<Path>
FileVisitor that deletes files that are accepted by all PathFilters. Directories are ignored.
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • basePath

      private final Path basePath
    • testMode

      private final boolean testMode
    • pathConditions

      private final List<? extends PathCondition> pathConditions
  • Constructor Details

    • DeletingVisitor

      public DeletingVisitor(Path basePath, List<? extends PathCondition> pathConditions, boolean testMode)
      Constructs a new DeletingVisitor.
      Parameters:
      basePath - used to relativize paths
      pathConditions - objects that need to confirm whether a file can be deleted
      testMode - 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.
  • Method Details