public class CopyFileVisitor extends SimpleFileVisitor<Path>
FileVisitor
which copies the source Path
to the target Path
. Constructor and Description |
---|
CopyFileVisitor(Path source,
Path target)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
static Path |
copy(Path source,
Path target)
Copies the source to the target.
|
FileVisitResult |
preVisitDirectory(Path dir,
BasicFileAttributes attrs) |
FileVisitResult |
visitFile(Path file,
BasicFileAttributes attrs) |
postVisitDirectory, visitFileFailed
public CopyFileVisitor(Path source, Path target)
source
- the sourcetarget
- the targetcopy(java.nio.file.Path, java.nio.file.Path)
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException
preVisitDirectory
in interface FileVisitor<Path>
preVisitDirectory
in class SimpleFileVisitor<Path>
IOException
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException
visitFile
in interface FileVisitor<Path>
visitFile
in class SimpleFileVisitor<Path>
IOException
public static Path copy(Path source, Path target) throws IOException
source
- the sourcetarget
- the targetIOException
Copyright © 2002–2015 SoftSmithy. All rights reserved.