public class CopyDirectoryVisitor extends CountingPathVisitor
| Modifier and Type | Field and Description |
|---|---|
private java.nio.file.CopyOption[] |
copyOptions |
private static java.nio.file.CopyOption[] |
EMPTY_COPY_OPTIONS |
private java.nio.file.Path |
sourceDirectory |
private java.nio.file.Path |
targetDirectory |
EMPTY_STRING_ARRAY| Constructor and Description |
|---|
CopyDirectoryVisitor(Counters.PathCounters pathCounter,
java.nio.file.Path sourceDirectory,
java.nio.file.Path targetDirectory,
java.nio.file.CopyOption... copyOptions)
Constructs a new visitor that deletes files except for the files and directories explicitly given.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
copy(java.nio.file.Path sourceFile,
java.nio.file.Path targetFile)
Copies the sourceFile to the targetFile.
|
boolean |
equals(java.lang.Object obj) |
java.nio.file.CopyOption[] |
getCopyOptions()
Gets the copy options.
|
java.nio.file.Path |
getSourceDirectory()
Gets the source directory.
|
java.nio.file.Path |
getTargetDirectory()
Gets the target directory.
|
int |
hashCode() |
java.nio.file.FileVisitResult |
preVisitDirectory(java.nio.file.Path directory,
java.nio.file.attribute.BasicFileAttributes attributes) |
java.nio.file.FileVisitResult |
visitFile(java.nio.file.Path sourceFile,
java.nio.file.attribute.BasicFileAttributes attributes) |
getPathCounters, postVisitDirectory, toString, updateFileCounters, withBigIntegerCounters, withLongCountersprivate static final java.nio.file.CopyOption[] EMPTY_COPY_OPTIONS
private final java.nio.file.CopyOption[] copyOptions
private final java.nio.file.Path sourceDirectory
private final java.nio.file.Path targetDirectory
public CopyDirectoryVisitor(Counters.PathCounters pathCounter, java.nio.file.Path sourceDirectory, java.nio.file.Path targetDirectory, java.nio.file.CopyOption... copyOptions)
pathCounter - How to count visits.sourceDirectory - The source directorytargetDirectory - The target directorycopyOptions - Specifies how the copying should be done.protected void copy(java.nio.file.Path sourceFile,
java.nio.file.Path targetFile)
throws java.io.IOException
sourceFile - the source file.targetFile - the target file.java.io.IOException - if an I/O error occurs.public boolean equals(java.lang.Object obj)
equals in class CountingPathVisitorpublic java.nio.file.CopyOption[] getCopyOptions()
public java.nio.file.Path getSourceDirectory()
public java.nio.file.Path getTargetDirectory()
public int hashCode()
hashCode in class CountingPathVisitorpublic java.nio.file.FileVisitResult preVisitDirectory(java.nio.file.Path directory,
java.nio.file.attribute.BasicFileAttributes attributes)
throws java.io.IOException
preVisitDirectory in interface java.nio.file.FileVisitor<java.nio.file.Path>preVisitDirectory in class java.nio.file.SimpleFileVisitor<java.nio.file.Path>java.io.IOExceptionpublic java.nio.file.FileVisitResult visitFile(java.nio.file.Path sourceFile,
java.nio.file.attribute.BasicFileAttributes attributes)
throws java.io.IOException
visitFile in interface java.nio.file.FileVisitor<java.nio.file.Path>visitFile in class CountingPathVisitorjava.io.IOException