public class DeletingPathVisitor extends CountingPathVisitor
Modifier and Type | Field and Description |
---|---|
private java.nio.file.LinkOption[] |
linkOptions |
private boolean |
overrideReadOnly |
private java.lang.String[] |
skip |
EMPTY_STRING_ARRAY
Constructor and Description |
---|
DeletingPathVisitor(Counters.PathCounters pathCounter,
DeleteOption[] deleteOption,
java.lang.String... skip)
Constructs a new visitor that deletes files except for the files and directories explicitly given.
|
DeletingPathVisitor(Counters.PathCounters pathCounter,
java.nio.file.LinkOption[] linkOptions,
DeleteOption[] deleteOption,
java.lang.String... skip)
Constructs a new visitor that deletes files except for the files and directories explicitly given.
|
DeletingPathVisitor(Counters.PathCounters pathCounter,
java.lang.String... skip)
Constructs a new visitor that deletes files except for the files and directories explicitly given.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
accept(java.nio.file.Path path)
Returns true to process the given path, false if not.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
java.nio.file.FileVisitResult |
postVisitDirectory(java.nio.file.Path dir,
java.io.IOException exc) |
java.nio.file.FileVisitResult |
preVisitDirectory(java.nio.file.Path dir,
java.nio.file.attribute.BasicFileAttributes attrs) |
java.nio.file.FileVisitResult |
visitFile(java.nio.file.Path file,
java.nio.file.attribute.BasicFileAttributes attrs) |
static DeletingPathVisitor |
withBigIntegerCounters()
Constructs a new instance configured with a BigInteger
Counters.PathCounters . |
static DeletingPathVisitor |
withLongCounters()
Constructs a new instance configured with a long
Counters.PathCounters . |
defaultDirFilter, defaultFileFilter, getPathCounters, toString, updateDirCounter, updateFileCounters
visitFileFailed
private final java.lang.String[] skip
private final boolean overrideReadOnly
private final java.nio.file.LinkOption[] linkOptions
public DeletingPathVisitor(Counters.PathCounters pathCounter, DeleteOption[] deleteOption, java.lang.String... skip)
pathCounter
- How to count visits.deleteOption
- How deletion is handled.skip
- The files to skip deleting.public DeletingPathVisitor(Counters.PathCounters pathCounter, java.nio.file.LinkOption[] linkOptions, DeleteOption[] deleteOption, java.lang.String... skip)
pathCounter
- How to count visits.linkOptions
- How symbolic links are handled.deleteOption
- How deletion is handled.skip
- The files to skip deleting.public DeletingPathVisitor(Counters.PathCounters pathCounter, java.lang.String... skip)
pathCounter
- How to count visits.skip
- The files to skip deleting.public static DeletingPathVisitor withBigIntegerCounters()
Counters.PathCounters
.Counters.PathCounters
.public static DeletingPathVisitor withLongCounters()
Counters.PathCounters
.Counters.PathCounters
.private boolean accept(java.nio.file.Path path)
path
- the path to test.public boolean equals(java.lang.Object obj)
equals
in class CountingPathVisitor
public int hashCode()
hashCode
in class CountingPathVisitor
public java.nio.file.FileVisitResult postVisitDirectory(java.nio.file.Path dir, java.io.IOException exc) throws java.io.IOException
postVisitDirectory
in interface java.nio.file.FileVisitor<java.nio.file.Path>
postVisitDirectory
in class CountingPathVisitor
java.io.IOException
public java.nio.file.FileVisitResult preVisitDirectory(java.nio.file.Path dir, java.nio.file.attribute.BasicFileAttributes attrs) throws java.io.IOException
preVisitDirectory
in interface java.nio.file.FileVisitor<java.nio.file.Path>
preVisitDirectory
in class CountingPathVisitor
java.io.IOException
public java.nio.file.FileVisitResult visitFile(java.nio.file.Path file, java.nio.file.attribute.BasicFileAttributes attrs) throws java.io.IOException
visitFile
in interface java.nio.file.FileVisitor<java.nio.file.Path>
visitFile
in class CountingPathVisitor
java.io.IOException