public class CleaningPathVisitor extends CountingPathVisitor
Constructor and Description |
---|
CleaningPathVisitor(Counters.PathCounters pathCounter,
String... skip)
Constructs a new visitor that deletes files except for the files and directories explicitly given.
|
Modifier and Type | Method and Description |
---|---|
FileVisitResult |
preVisitDirectory(Path dir,
BasicFileAttributes attributes) |
FileVisitResult |
visitFile(Path file,
BasicFileAttributes attributes) |
static CountingPathVisitor |
withBigIntegerCounters()
Creates a new instance configured with a BigInteger
Counters.PathCounters . |
static CountingPathVisitor |
withLongCounters()
Creates a new instance configured with a long
Counters.PathCounters . |
equals, getPathCounters, hashCode, postVisitDirectory, toString, updateFileCounters
visitFileFailed
public CleaningPathVisitor(Counters.PathCounters pathCounter, String... skip)
pathCounter
- How to count visits.skip
- The files to skip deleting.public static CountingPathVisitor withBigIntegerCounters()
Counters.PathCounters
.Counters.PathCounters
.public static CountingPathVisitor withLongCounters()
Counters.PathCounters
.Counters.PathCounters
.public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attributes) throws IOException
preVisitDirectory
in interface FileVisitor<Path>
preVisitDirectory
in class SimpleFileVisitor<Path>
IOException
public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException
visitFile
in interface FileVisitor<Path>
visitFile
in class CountingPathVisitor
IOException
Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.