Class LoggingVisitor
- All Implemented Interfaces:
FileVisitor<Path>
public final class LoggingVisitor extends SimpleFileVisitor<Path>
A @{link
FileVisitor
copies directory trees keeping a note of all copied target files.-
Field Summary
-
Constructor Summary
Constructors Constructor Description LoggingVisitor(Path fromDir, Path toDir)
Constructor. -
Method Summary
Modifier and Type Method Description List<Path>
getCopiedList()
did we find a name clash?FileVisitResult
preVisitDirectory(Path dir, BasicFileAttributes attrs)
FileVisitResult
visitFile(Path file, BasicFileAttributes attrs)
Methods inherited from class java.nio.file.SimpleFileVisitor
postVisitDirectory, visitFileFailed
-
Field Details
-
copiedFiles
How what files have we copied? -
log
private final org.slf4j.Logger loglogger. -
from
Path we are traversing. -
to
Path where we check for Duplicates.
-
-
Constructor Details
-
LoggingVisitor
Constructor.- Parameters:
fromDir
- Path we are traversingtoDir
- Path where we check for Duplicates
-
-
Method Details
-
preVisitDirectory
- Specified by:
preVisitDirectory
in interfaceFileVisitor<Path>
- Overrides:
preVisitDirectory
in classSimpleFileVisitor<Path>
- Throws:
IOException
-
visitFile
- Specified by:
visitFile
in interfaceFileVisitor<Path>
- Overrides:
visitFile
in classSimpleFileVisitor<Path>
- Throws:
IOException
-
getCopiedList
did we find a name clash?- Returns:
- whether we found a name clash.
-