Class 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.
    • Constructor Detail

      • 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.